I have to solve an overflow error which come in a report statment of accounts. here's the code:
"AppliedDocNo.":=''; //PM
IF("Cust. Ledger Entry"."Document Type"="Cust. Ledger Entry"."Document Type"::"Credit Memo") AND
("Cust. Ledger Entry"."Closed by Entry No." = 0 ) THEN BEGIN
recCLE.RESET;
//recCLE.SETRANGE(recCLE."Entry No.","Cust. Ledger Entry"."Closed by Entry No.");
recCLE.SETRANGE(recCLE."Closed by Entry No.","Cust. Ledger Entry"."Entry No.");
IF recCLE.FINDFIRST THEN BEGIN
//"AppliedDocNo.":=''; //PM
REPEAT
"AppliedDocNo." := "AppliedDocNo." + ','+ recCLE."Document No.";
UNTIL recCLE.NEXT = 0 ;
END;
END
ELSE
IF("Cust. Ledger Entry"."Document Type"="Cust. Ledger Entry"."Document Type"::"Credit Memo") AND
("Cust. Ledger Entry"."Closed by Entry No." <> 0 ) THEN BEGIN
//"AppliedDocNo.":=''; //PM
recCLE.RESET;
recCLE.SETRANGE(recCLE."Entry No.","Cust. Ledger Entry"."Closed by Entry No.");
IF recCLE.FINDFIRST THEN BEGIN
//"AppliedDocNo.":=''; //PM
REPEAT
"AppliedDocNo." := "AppliedDocNo." + ','+ recCLE."Document No.";
UNTIL recCLE.NEXT = 0 ;
END;
END
ELSE
IF("Cust. Ledger Entry"."Document Type"="Cust. Ledger Entry"."Document Type"::Invoice) AND
("Cust. Ledger Entry"."Closed by Entry No." <> 0)THEN BEGIN
//"AppliedDocNo.":=''; //PM
recCLE.RESET;
recCLE.SETRANGE(recCLE."Entry No.","Cust. Ledger Entry"."Closed by Entry No.");
IF recCLE.FINDFIRST THEN BEGIN
//"AppliedDocNo.":=''; //PM
REPEAT
"AppliedDocNo." := "AppliedDocNo." + ','+ recCLE."Document No.";
UNTIL recCLE.NEXT = 0 ;
END;
END
ELSE
IF("Cust. Ledger Entry"."Document Type"="Cust. Ledger Entry"."Document Type"::Invoice) AND
("Cust. Ledger Entry"."Closed by Entry No." = 0)THEN BEGIN
//"AppliedDocNo.":=''; //PM
recCLE.RESET;
recCLE.SETRANGE(recCLE."Closed by Entry No.","Cust. Ledger Entry"."Entry No.");
IF recCLE.FINDFIRST THEN BEGIN
//"AppliedDocNo.":=''; //PM
REPEAT
"AppliedDocNo." := "AppliedDocNo." + ','+ recCLE."Document No.";
UNTIL recCLE.NEXT = 0 ;
END;
END
ELSE
IF("Cust. Ledger Entry"."Document Type"="Cust. Ledger Entry"."Document Type"::" ") OR
("Cust. Ledger Entry"."Document Type"="Cust. Ledger Entry"."Document Type"::Payment)THEN BEGIN
//"AppliedDocNo.":=''; //PM
recDetailCustLedgerEntry.RESET;
recDetailCustLedgerEntry.SETRANGE(recDetailCustLedgerEntry."Applied Cust. Ledger Entry No.","Cust. Ledger Entry"."Entry No.");
IF recDetailCustLedgerEntry.FINDFIRST THEN BEGIN
//"AppliedDocNo.":=''; //PM
REPEAT
IF recDetailCustLedgerEntry."Cust. Ledger Entry No." <> recDetailCustLedgerEntry."Applied Cust. Ledger Entry No." THEN BEGIN
recCLE.GET(recDetailCustLedgerEntry."Cust. Ledger Entry No.");
"AppliedDocNo." := "AppliedDocNo." + ','+ recCLE."Document No.";
END;
UNTIL recDetailCustLedgerEntry.NEXT = 0 ;
END;
END;
StrLength := STRLEN("AppliedDocNo.");
"AppliedDocNo1." := COPYSTR("AppliedDocNo.",2,MAXSTRLEN("AppliedDocNo1."));
the excel displays applieddocno1.
please CAN ANYONE SUGGEST WHAT TO DO,.i have been trying it since three days. one of the recrds cotains 40 applied docs related to it.... ](*,)
0
Comments
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav