Hi Experts,
I want to write a job where I have to update E-Invoicing status from None to IRN Generated. I have also tried please let me know where I'm wrong.
Thanks & Regards
static void vtsUpdateEInvoicingStatus() { CustInvoiceJour custInvoiceJour; ttsBegin; while select forUpdate custInvoiceJour where custInvoiceJour.AcxEInvoicingStatus == "None" { custInvoiceJour.AcxEInvoicingStatus = custInvoiceJour.IRNGenerated(); custInvoiceJour.update(); } //update_recordSet ttsCommit; info("DONE"); }
Hi ax.tech,
Is AcxEInvoicingStatus is your custom field?
What is the data type for that field?
Thanks,
Girish S.
Hi Girish,
Thanks for replying. Yes it is a custom field with type enum.
Try the below code.
What is the logic added in this method custInvoiceJour.IRNGenerated()?
I think this is where I'm wrong can you please help and correct this ?
Thanks in advance
So you want to update all the record which are having none status to IR Genrated.
Try the below code. Replace "YourEnumName" with your custom enum name.
static void vtsUpdateEInvoicingStatus() { CustInvoiceJour custInvoiceJour; ttsBegin; while select forUpdate custInvoiceJour where custInvoiceJour.AcxEInvoicingStatus == YourEnumName::None { custInvoiceJour.AcxEInvoicingStatus = YourEnumName::IRNGenrated; custInvoiceJour.update(); } //update_recordSet ttsCommit; info("DONE"); }
Getting this error.
Can you show me the screenshot of the error?
Screenshot is not showing if you have attached in the previous replies.
Error may be due to some validation written on the "CustInoviceJour" table update method.
So try to change the code from custInvoiceJour.update() to custInvoiceJour.doUpdate().
It is working fine now. Thank you so much for your valuable and support means a lot.
Please mark it as verified( Yes ) if its solved your issue.
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 Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CA Neeraj Kumar 2,157
André Arnaud de Cal... 883 Super User 2025 Season 2
Sohaib Cheema 674 User Group Leader