Copying Narration from customised table to G/L Entry table

lavanyaballurgilavanyaballurgi Member Posts: 235
Hello experts,

The requirement was to copy first 5 lines of Narration stored in "Posted Narration" table (customised table) to a new field created in "G/L entry" Table. The field in "Posted Narration" table correspond to G/L entry are "Document No. & Posting Date". Now I made a report with a button & made this code to run on button.
WITH lrc_glentry DO BEGIN

ltx_Narration := '';
lin_count := 0;
lrc_PostedNarration.SETCURRENTKEY("Document No.","Posting Date");
lrc_postednarration.SETRANGE("Document No.",lrc_glentry."Document No.");
lrc_postednarration.SETRANGE("Posting Date",lrc_glentry."Posting Date");

IF lrc_postednarration.FINDFIRST THEN
REPEAT
ltx_Narration := ltx_Narration + lrc_postednarration.Narration +'';
lin_count += 1;
UNTIL (lrc_postednarration.NEXT=0) OR (lin_count <= 5);

lrc_glentry.Narration := ltx_Narration;
lrc_glentry.MODIFY(FALSE);

END;


Now the error shows "G/L Entry Entry No. '0' does not exist"

What Am I missing?

Answers

Sign In or Register to comment.