Gbenga
November 6, 2009, 11:28am
1
Dear all,
Could some one help me with these code, i wrote these code to update the credit limit on customer card base on certain condition but seems not to be working(The credit limit was not update at all) . i Set the report to processonly to yes.
“Cust. Ledger Entry”.CALCFIELDS(“Cust. Ledger Entry”.Amount);
“Cust. Ledger Entry”.Amount:= Customer.“Balance (LCY)”;
Customer.SETRANGE(Customer.“No.”,Customer.“No.”);
IF (Customer.“Balance (LCY)”= 0) AND (Customer.“Credit Limit (LCY)” = 0) THEN BEGIN
Customer.“Credit Limit (LCY)” :=100000;
END;
I think this line is missing:
IF (Customer.“Balance (LCY)”= 0) AND (Customer.“Credit Limit (LCY)” = 0) THEN BEGIN
Customer.“Credit Limit (LCY)” :=100000;
Customer.MODIFY(TRUE);
END;
Gbenga
November 6, 2009, 1:04pm
4
Hi,
The amount inserted inrespective of the condition. The condition are not being taking into consideration. Any help
Thanks for the missing line
Gbenga
DRB
November 6, 2009, 1:23pm
5
Try the following:
Create a processing only report with Customer as data item and onAfterGetRecord write the following code:
Customer.CALCFIELDS(.“Balance (LCY)”);
IF (“Balance (LCY)”= 0) AND (“Credit Limit (LCY)” = 0) THEN BEGIN
“Credit Limit (LCY)” :=100000;
MODIFY(TRUE);
END;
And on OnPostReport section you may write a message, informing completion of report.
Gbenga
November 6, 2009, 2:19pm
6
Hi,
Thanks, i finally got it working as expected. Really i don’t know what went wrong but it surelly working now. Use the same code you gave me.
Gbenga
DRB
November 6, 2009, 2:58pm
7
Gbenga,
Which code worked for you? You had another post also for this issue, I suggest you to identify the post which helped you and “Verify Solution” , which will be helpful to someone else in future if he/she encounters same situation.
Gbenga
November 7, 2009, 10:46am
8
Hi,
Thanks for reminding me the code above works just as i wanted.
Gbenga