referring to the row above

asemberengasembereng Member Posts: 220
Hi everyone, i am novice to Navision. I am working on a report that needs to compare two different rows within the same same table. I want it to compare the amount where document type is finance charge memo and where the next row document type is payment being compared to the amount the payment is being applied and if the payment is less than the finance charge it should take the payment as finance charge. can someone Please help me out.
Thanks

IF "Document Type"="Document Type":: "Finance Charge Memo" THEN BEGIN
Fincharge :="Remaining Amount";
END;

IF "Document Type"="Document Type"::Payment THEN BEGIN
Principal:= "Closed by Amount";
// ***************************************************************8
IF Amount < Fincharge THEN
Fincharge := Amount;

IF Principal=0 THEN
Fincharge :=-ABS(Amount)
ELSE
// ***************************************************************8
Fincharge :=ABS(Amount)-ABS(Principal);

Comments

  • krikikriki Member, Moderator Posts: 9,110
    Create an extra global variable on your table. In the OnAfterGetRecord-trigger, save the record of the dataitem into the extra global variable. This way you can compare the records.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • asemberengasembereng Member Posts: 220
    Sorry i might have stated the question wrongly but this rows comparison doesn't necessarily be the row directly above the one to be compare. the rows to be compared are non-static; meaning it has to loop through the table and where ever the condition is met it takes the amount from there. This Table is the Cust. Ledger Entry.
    Thank you Kirki for the reply.
    And can you please elaborate more on what you were saying.
  • krikikriki Member, Moderator Posts: 9,110
    Each time you read a record to print, save it (but only those records that might be needed later) in a temptable (global variable on your table but with property TempTable=Yes). This way you don't need to read the real DB to find your record again (this costs DB-access), but you just read your temptable.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • asemberengasembereng Member Posts: 220
    Thanks Kirki. I will try that.. What do you know about saving JPEG in Navision database or TIFF? I saved a file format of BMP but it diplays only half of the file. I resized it but is still not displaying the whole the document.
    Thanks for your help.
  • krikikriki Member, Moderator Posts: 9,110
    asembereng wrote:
    Thanks Kirki. I will try that.. What do you know about saving JPEG in Navision database or TIFF? I saved a file format of BMP but it diplays only half of the file. I resized it but is still not displaying the whole the document.
    Thanks for your help.
    Search the forum. There are a lot of topics on this.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.