Hi
I have Location table as Main and Custom Table Issue Lines on Sub Form. I have set temporary table as the source of the subform
CDNLine is of Record Data Type with SubType Issue Lines.
I have written below code on Push of button but it is not displaying any data in SubForm.
TEntry.RESET;
TEntry.SETCURRENTKEY("Location",Date);
TEntry.SETRANGE("Location","No.");
TEntry.SETRANGE(Date,TempDate,WORKDATE);
IF TEntry.FINDFIRST THEN REPEAT
Amount := 0;
TPLine.RESET;
TPLine.SETRANGE("Location","No.");
TPLine.SETRANGE(Date,TempDate);
IF TPLine.FINDFIRST THEN REPEAT
Amount += TPLine."Amount";
UNTIL TPLine.NEXT = 0;
IF Amount > 0 THEN BEGIN
CDNLine.RESET;
CDNLine.SETRANGE("Location","No.");
CDNLine.SETRANGE("Sale Date",TempDate);
IF CDNLine.FINDFIRST THEN BEGIN
CDNLine."Sale Amount" := Amount;
CDNLine.MODIFY;
END ELSE BEGIN
CDNLine.INIT;
EntryNo := EntryNo + 1;
CDNLine.VALIDATE("Location","No.");
CDNLine.VALIDATE("Entry No",EntryNo);
CDNLine.VALIDATE("Sale Date",TempDate);
CDNLine.VALIDATE("Sale Amount", Amount);
CDNLine.INSERT;
END;
END;
TempDate := TempDate + 1;
UNTIL TempDate > WORKDATE;
CurrForm.UPDATE(TRUE);
Thanks
0
Answers
It is only two clicks.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03