How to read Data from Subform

jsshivalikjsshivalik Member Posts: 67
Hi

https://imgur.com/scLGnHa

I have Main Form (Location) & SaleDeposit SubForm (Source table is SaleDepositLines) . I have 1 Button . On Push Trigger of Button

I want those lines which have DepositAmount > 0 should be inserted in same table SaleDepositLines. I am trying below code but not working

CDLine refers to the same table which Subform refers to

CDLine.RESET;

CDLine.SETRANGE("Location.","No.");

CDLine.SETFILTER("Deposit Amount",'<>%1',0);

IF CDLine.FINDFIRST THEN BEGIN

REPEAT

CDLine.INIT;

EntryNo := EntryNo + 1;

CDLine.VALIDATE("Entry No.",EntryNo);

CDLine.VALIDATE("Location","No.");

CDLine.VALIDATE("Posted Amount", CDLine."Deposit Amount");

CDLine.INSERT;

UNTIL CDLine.NEXT = 0;

END;

Thanks


Thanks

Best Answer

Answers

Sign In or Register to comment.