Import Item Journal Line through XML port validate Amount

divyesh10divyesh10 Member Posts: 71
I am trying to import item journal Line through XML Port in Navision 2013 R2.
i want to validate Amount in the item journal Line If the Value Is Zero else it should not validate
i did the following steps
Defined the Amount

Node Name Node Type Source Type Data Source
Amount Element Text <Amount>

Added following Code onAfterInsert

IF Amount <>'' THEN BEGIN
EVALUATE(decAmount,Amount);
IF decAmount = 0 THEN BEGIN
IF "Item Journal Line"."Entry Type" = "Item Journal Line"."Entry Type"::Sale THEN BEGIN
"Item Journal Line".VALIDATE(Amount,decAmount);
END ELSE BEGIN
"Item Journal Line".Amount := decAmount;
END;
END ELSE BEGIN
"Item Journal Line".Amount := decAmount;
END;
END;

But stil i am not getting my out put

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    Maybe at the end add;
    "Item Journal Line".MODIFY;
    
    ?

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • ssmukhissmukhi Member Posts: 10
    tinoruijs wrote: »
    Maybe at the end add;
    "Item Journal Line".MODIFY;
    
    ?

    Thank you so much for this. I have been figuring this out for days! This line helped and also instead of using the OnAfterInsertRecord trigger, I used the OnAfterModifyTrigger and it worked like a charm! :)
Sign In or Register to comment.