AL icon indicating copy to clipboard operation
AL copied to clipboard

Txt2AL does not convert page delta that modified property of control when control name has space character

Open ernestasju opened this issue 8 years ago • 3 comments

I am using Txt2AL from microsoft/bcsandbox build 12.2.22932.23097.

Delta file:

OBJECT Modification "Vendor Card"(Page 26)
{
  OBJECT-PROPERTIES
  {
    Date=20180615D;
    Time=120000T;
    Modified=true;
    Version List=NAVW112.10;
  }
  PROPERTIES
  {
    Target="Vendor Card"(Page 26);
    TargetPageType=Card;
  }
  CHANGES
  {
    { PropertyModification;
                         Target="Customized Calendar"(Control 121);
                         Property=CaptionML;
                         OriginalValue=ENU=Customized Calendar;
                         ModifiedValue=[ENU=Customized Calendar;
                                        LTH=Pritaikytas kalendorius] }
  }
  CODE
  {

    BEGIN
    END.
  }
}

Txt2AL output:

PS C:\Users\ernjus\Desktop\test> & 'C:\ProgramData\NavContainerHelper\Extensions\toc\Program Files\122\RoleTailored Client\Txt2Al.exe' --source=C:\Users\ernjus\Desktop\test\deltas --target=C:\Users\ernjus\Desktop\test\alfiles

----ERROR----
Error converting file:C:\Users\ernjus\Desktop\test\deltas\PAG26.DELTA
Length cannot be less than zero.
Parameter name: length

Total Time: 0:00:00,2500212
Errors: 1

Removing space character solves the problem.

Delta file:

OBJECT Modification "Vendor Card"(Page 26)
{
  OBJECT-PROPERTIES
  {
    Date=20180615D;
    Time=120000T;
    Modified=true;
    Version List=NAVW112.10;
  }
  PROPERTIES
  {
    Target="Vendor Card"(Page 26);
    TargetPageType=Card;
  }
  CHANGES
  {
    { PropertyModification;
                         Target="CustomizedCalendar"(Control 121);
                         Property=CaptionML;
                         OriginalValue=ENU=Customized Calendar;
                         ModifiedValue=[ENU=Customized Calendar;
                                        LTH=Pritaikytas kalendorius] }
  }
  CODE
  {

    BEGIN
    END.
  }
}

Txt2AL output:

Overwriting: C:\Users\ernjus\Desktop\test\alfiles\PAG26.al

Total Time: 0:00:00,7020073
Errors: 0

This is not a high priority for me.

ernestasju avatar Jul 05 '18 13:07 ernestasju

Actually it is not only space. Control names with special characters cause the same error, eg:

    { PropertyModification;
                         Target="Ven&dor"(Action 64);
                         Property=CaptionML;
                         OriginalValue=ENU=Ven&dor;
                         ModifiedValue=[ENU=Ven&dor;
                                        LTH=Tie&kÓjas] }

ernestasju avatar Jul 05 '18 13:07 ernestasju

Same for property insertions.

    { PropertyInsertion ;Target="Profit %"(Control 181);
                         Property=CaptionML;
                         ModifiedValue= }

ernestasju avatar Jul 05 '18 13:07 ernestasju

Hi @ernestasju, thank you for reporting this issue. We also found out about this error when having a space in the control name and it is fixed in our latest master.

qutreson avatar Jul 06 '18 13:07 qutreson