question:
Create a report that will create a line in Gen Journal for each customer with his outstanding balance
good evening all,
this is assignment question
i have written the code in
on after get record() and set the property is processing only yes
Customer.CALCFIELDS(Customer.Balance);
IF Customer.Balance <>0 THEN
BEGIN
gjline.INIT;
gjline.SETRANGE(gjline."Journal Template Name",'general');
gjline.SETRANGE(gjline."Journal Batch Name",'default');
gjline."Balance (LCY)" :=Customer.Balance;
gjline.INSERT
END
but it was showing the error ,i am sharing the screen
what about this error,what i have written is correct or wrong any suggest me please
thank you
0
Comments
can you suggest me the code
thank you
can you forward the programming guide please
thank you
A similar kinda option is there in Payment Journal > Function > Suggest Vendor Payment which list out the vendor with outstanding payments.
What I found missing in your development was -
1. Document No.
2. Account Type (should be CUSTOMER)
3. Account No. (should be the Customer No.)
4. Line No. (starts with 10000)
Try to get these in you Code.
i have tried this code in on after get record.but it was throwing an error
Customer.CALCFIELDS(Customer.Balance);
IF Customer.Balance <>0 THEN
MESSAGE('%1',Customer.Balance);
gjline.RESET;
gjline.SETRANGE(gjline."Journal Template Name",'Assets');
gjline.SETRANGE(gjline."Journal Batch Name",'Default');
gjline.VALIDATE(gjline."Journal Template Name",'Assets');
gjline.VALIDATE(gjline."Journal Batch Name",'Default');
gjline.INIT;
line :=0;
IF gjline.FINDLAST THEN
gjline."Line No.":=line+ 10000
ELSE
gjline."Line No.":=gjline."Line No."+10000;
gjline."Account Type":=gjline."Account Type"::Customer;
gjline."Account No." :=Customer."No.";
gjline."Balance (LCY)" :=Customer.Balance;
gjline.INSERT
Better you validate Account Type, Account No. fields..
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
i used if not instead of if
IF not gjline.FINDLAST THEN
gjline."Line No.":=line+ 10000
ELSE
gjline."Line No.":=gjline."Line No."+10000;
gjline."Account Type":=gjline."Account Type"::Customer;
gjline."Account No." :=Customer."No.";
gjline."Balance (LCY)" :=Customer.Balance;
gjline.INSERT
thanks for giving reply and spending your valuable time
gjline.VALIDATE("Account No.",Customer."No.");
and dont forget to mark it as SOLVED if your query is resolved.