...
DtldCustLedgEntry@1001 : Record 379;
BEGIN
// Delete the following lines.
DtldCustLedgEntry.SETCURRENTKEY("Cust. Ledger Entry No.");
DtldCustLedgEntry.SETRANGE("Cust. Ledger Entry No.",CustLedgEntry."Entry No.");
IF DtldCustLedgEntry.FIND('-') THEN
REPEAT
IF (DtldCustLedgEntry."Entry Type" <> DtldCustLedgEntry."Entry Type"::"Initial Entry") AND
(NOT DtldCustLedgEntry.Unapplied)
THEN
ERROR(
Text000,CustLedgEntry.TABLECAPTION,CustLedgEntry."Entry No.");
UNTIL DtldCustLedgEntry.NEXT = 0;
// End of the deleted lines.
END;
...
...
DtldCustLedgEntry@1001 : Record 379;
BEGIN
// Add the following lines.
DtldCustLedgEntry.SETCURRENTKEY("Cust. Ledger Entry No.","Entry Type");
DtldCustLedgEntry.SETRANGE("Cust. Ledger Entry No.",CustLedgEntry."Entry No.");
DtldCustLedgEntry.SETFILTER("Entry Type",'<>%1',DtldCustLedgEntry."Entry Type"::"Initial Entry");
DtldCustLedgEntry.SETRANGE(Unapplied,FALSE);
IF NOT DtldCustLedgEntry.ISEMPTY THEN
ERROR(Text000,CustLedgEntry.TABLECAPTION,CustLedgEntry."Entry No.");
DtldCustLedgEntry.SETRANGE(Unapplied);
DtldCustLedgEntry.SETFILTER("Entry Type",'%1|%2',
DtldCustLedgEntry."Entry Type"::"Realized Gain",DtldCustLedgEntry."Entry Type"::"Realized Loss");
IF NOT DtldCustLedgEntry.ISEMPTY THEN
ERROR(Text013,CustLedgEntry.TABLECAPTION,CustLedgEntry."Entry No.");
// End of the added lines.
END;
...