Notifications
Announcements
No record found.
Hi
I want if Balance is < 0 then it should show Balance Amount + 'Dr'. If > 0 then Balance Amount + 'Cr' in report textfield
Thanks
*This post is locked for comments
You can write this code on onaftergetrecord trigger
If balance >0 then
Balanceamount :=format (balance)+'dr'
Else
Balanceamount:=format(balance)+'cr'
Define balanceamount aa variable with datatype text
Hi,
You can define a variable 'Result' with datatype 'Text' in C/AL globals. Now in OnAfterGetRecord trigger you can write the following code:
IF Balance <0 THEN
Result:=FORMAT(Balance)+' Dr'
ELSE
Result:=FORMAT(Balance)+' Cr';
Use this text variable 'Result' in your report textfield.
You may use the methods mentioned by Amol and Tina
Yes, you may use the methods by Amol sir and Tina.
Or else you can directly provide the Expression of the Textbox as:
iif(Balance < 0,CStr(Balance)+"Dr",CStr(Balance)+"Cr")
-Yogesh KulkarniPlease verify, if you find answer helpful.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.