Dataport and Dimension

SYLV1GSYLV1G Member Posts: 93
Hello

I try to import data from a dataport to a general journal

After the line insertion, i run codeunit Gen. Jnl.-Check Line to check the data but i get an error message "A dimension used in has caused an error... Select a dimension value code for the dimension..

If i delete the line "run codeunit Gen..." it works

Has anybody got an idea ?

Thanks in advance

SG

"Gen. Journal Line".Description := AnsiToAscii.Ansi2Ascii(COPYSTR(Desc,1,50));

IF Dim1 <> '' THEN
  "Gen. Journal Line".VALIDATE("Shortcut Dimension 1 Code",Dim1);
IF Dim2 <> '' THEN
  "Gen. Journal Line".VALIDATE("Shortcut Dimension 2 Code",Dim2);
IF Dim3 <> '' THEN
  "Gen. Journal Line".ValidateShortcutDimCode(3,Dim3);

IF Amount=0 THEN  BEGIN
  InsertLogDesc('Ligne avec montant = 0 -> ',FORMAT(LineNo));
  CurrDataport.SKIP;
END;

"Gen. Journal Line".INSERT(TRUE);
lineInsert := lineInsert + 1;

CODEUNIT.RUN(CODEUNIT::"Gen. Jnl.-Check Line","Gen. Journal Line");

Comments

  • TrippyZTrippyZ Member Posts: 87
    Personally I use the CallFieldValidate option of the Dataport field, it seems to sort out the dimension requirements for me.

    Have you tried running with the debugger?

    Regards


    TrippyZ
    Professional Navision Developer
Sign In or Register to comment.