AL icon indicating copy to clipboard operation
AL copied to clipboard

Txt2AL: Multi-word tablerelations without quotes

Open epernst opened this issue 9 years ago • 7 comments

In the November build when exporting and converting objects with multi-word tablerelation's, then the table name is without quotes.

Example from table 36: field(23;"Payment Terms Code";Code[10]) { Caption = 'Payment Terms Code'; TableRelation = Payment Terms;

Here are the files exported and converted: T36.txt

Table 36 - Sales Header.al.txt

epernst avatar Nov 11 '17 10:11 epernst

We found out about this bug as well, this will be fixed in the next update.

qutreson avatar Nov 12 '17 20:11 qutreson

Out of curiosity as we continously convert our text objects, will this bug result in an .al compile error?

Could be nice to know before we update our development environment to the november release.

NicolaiEsbensen avatar Nov 14 '17 15:11 NicolaiEsbensen

In the case of a table with a name that should be quoted (like in the example, since the table contains a space), it will result in a compilation error. However, if the table relation does not need to be quoted or if the table relation contains if conditions, the property value given by the converter is correct.

qutreson avatar Nov 14 '17 15:11 qutreson

Did this fix not make it into the NAV 2018 update? I'm still running into missing quotes on RunPageLink, RunPageView, SubPageLink and SubPageView. Also on DataItemTableView and DataItemLink in the reports.

bwdeleeuw avatar Dec 06 '17 05:12 bwdeleeuw

The fix went into our December update and also made it into NAV 2018. I tried to reproduce it on the properties you mentioned, but it seemed to work for me. Were your files exported using the new syntax (the files should be compiled and then exported with ExportToNewSyntax)?

qutreson avatar Dec 06 '17 12:12 qutreson

@qutreson I did export using the new syntax.

I ran through the following steps:

  1. Technical Upgrade of NAV 2017 cu4 database to NAV 2018 RTM
  2. Export with finsql, command=ExportToNewSyntax
  3. Split using Split-NAVApplicationObjectFile
  4. Create Delta using Compare-NAVApplicationObject
  5. Run txt2al on Delta files
  6. Import into new AL project

I'm attaching one of the files here:

TAB232.TXT

bwdeleeuw avatar Dec 06 '17 14:12 bwdeleeuw

@qutreson

I think I found it. Your remark that the object should be compiled had me go back and compile the object after the technical upgrade. After that, I do end up with a better file. This was a customer database, so all objects were compiled, both before and after the TU, but there must be something in the compilation routine that does need to be explicitly rerun.

Thanks for the assist!

TAB232.TXT

bwdeleeuw avatar Dec 06 '17 14:12 bwdeleeuw