Sub Form

jsshivalikjsshivalik Posts: 38Member
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
Sign In or Register to comment.