Strange Import Error

MTCMTC Member Posts: 159
I'm still going through an upgrade process, and for the current database have exported the objects as text, run them through the conv-ml tool and am currently trying to import it back into Navision, fixing the errors on the way when this error appeared about 15 minutes ago and I cannot work it out at all.

Hay un error sintáctico en la importación en la línea 326903 en la posición 25:

OnPostDataItem=BEGIN.

El código AL no tiene la misma indentación que la primera línea


In English that would be something such as:

There is a syntax error in importing line 326903 in position 25

OnPostDataItem=BEGIN.

The AL code does not have the same indentation as the first line.

Has anyone come across this before or got a clue what this means? Looking at the text object file, there doesn't seem to be anything wrong.

Comments

  • JedrzejTJedrzejT Member Posts: 267
    HI

    open this txt file in editor, go to line no 25

    this line probably started from the begining of line.
    You must insert few space before line.

    Check intendation of other trigger and set the same for your error line


    Regards
  • MTCMTC Member Posts: 159
    JedrzejT wrote:
    HI

    open this txt file in editor, go to line no 25

    this line probably started from the begining of line.
    You must insert few space before line.

    Check intendation of other trigger and set the same for your error line


    Regards

    Thanks for the reply, but this is what I do not understand, the error is occuring on line 326903, a custom built report 50077, where would position 25 be?
    OnPostDataItem=BEGIN
                             //IF "C¢d. Operaci¢n"="C¢d. Operaci¢n"::"Pagar‚ del Ordenante" THEN
                             //BEGIN
                             //CLEAR(TextoSalida);
                             //TextoSalida :=
                             //  '06' + "C¢d. Opr" + PADSTR(NoCIF,10,' ') + PADSTR(Proveedor."CIF/NIF",12,' ') +
                             //  '910' + FORMAT(Efecto."Fecha vencimiento",6,5) {36 en total} + PADSTR('',7,' ');
                             //ArchSalida.WRITE(TextoSalida);
                             //END;
    
    
    
                             CLEAR(TextoSalida);
                             TextoSalida :=
                               '0806' + PADSTR(NoCIF,10,' ') + PADSTR('',12,' ') +
                               PADSTR('',3,' ') + CONVERTSTR(FORMAT(Efecto."Remaining Amt. (LCY)",10,Text004),' ','0') +
                               '00' {s¢n els 0's dels decimals} +
                               CONVERTSTR(FORMAT(TotalEfecs,8,Text004),' ','0') + CONVERTSTR(FORMAT(TotalRegtdo + 4 + 1,10,Text004),' ','0') +
                               PADSTR('',6,' ') + PADSTR('',7,' ');
                             ArchSalida.WRITE(TextoSalida);
                           END;
    

    Surely it cannot mean line 25 of the whole file, that reads:

    Text005 : TextConst 'ESP="HOY"';

    a text constant of CodeUnit1
  • MTCMTC Member Posts: 159
    I've found what the problem is.

    Indentation in this case does not refer to the number of spaces on the line in question, it refers to the level of logical indentation between {}

    In this case, and after solving it, the error also appears in other objects later in the file, the original programmer of the custom objects in this database has been placing comments using {...comment...} inside expressions. This leads to the real error actually being created 100 lines previously than the reported line number, with the real the error being in the code of the previous trigger, yet only after running the conv-ml tool, because it was fine before then.

    This strange use of comments inside expressions (100 or so lines before the reported error line)
    TextoSalida :=
      '06' + "Cód. Opr" + PADSTR(NoCIF,10,' ') + PADSTR(Proveedor."VAT Registration No.",12,' ') +
      '010' + CONVERTSTR(FORMAT(Efecto."Remaining Amt. (LCY)",10,'<integer>'),' ','0') +
      '00' {són els 0's dels decimals} + Proveedor2 + ProveCCCNoSucBanco + TotalCod + '1' { variar si es factible } +
      '9' {variar si es factible} + PADSTR('',2,' ') + ProveCCCDigControl + 
      FORMAT(Efecto."Due Date",6,5) + PADSTR('',1,' ');
    

    has clearly caused the conv-ml tool to become very confused, as it totally destroyed the 4th line shown above, turning it into:
    '00' {són els 0Text0051' { variar si es factible } +
    

    Obviously leaving an open curly brace with no ending curly brace. The import did not like this for obvious reasons.

    I think the moral of this tale is never to use block comments inside expressions.
  • fcrespofcrespo Member Posts: 9
    Thank you for your post.

    Actually the problem is not in indentation. It's just a sintax error in any line before the line number that error message shows.
    Felipe Crespo
  • DmitriySozinovDmitriySozinov Member Posts: 23
    fcrespo wrote:
    Thank you for your post.

    Actually the problem is not in indentation. It's just a sintax error in any line before the line number that error message shows.

    That is exactly true, what 'fcrespo' wrote. For instance, in my case I was missing an 'END;' statement in the middle of the object. Had to exclude the code piece-by-piece to realize what leads to the issue.
Sign In or Register to comment.