I need to create batch job to delete records from a table which is saving data per company and also from related table. I am able to delete the records using while select, but performance is very bad. Can someone please suggest me the best way to solve this problem?
A better approach is using delete_from statement and suppress all things that could cause the system to roll back to row-by-row processing.
What is your version of AX?
Thanks for the quick response.
I am using D365 F&O PU 54.
I tried 'delete_from crosscompany trvPBSMaindata'
but getting error while executing the code 'Cannot delete multiple records in Credit card (TrvPBSMaindata). Cross company delete_from operation should skip database logging.'
Moved from Dynamics AX Forum.
The message complains that you didn't suppress database logging, and you indeed didn't mention having code like that. Let me remind you that you should think about things that may cause the system to rollback to row-by-row processing and suppress them, if appropriate. This may include delete() method, alerts or database logging, for instance. Check out Conversion of operations from set-based to record-by-record for more details.
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 Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 683 Super User 2025 Season 2
CA Neeraj Kumar 620
Martin Dráb 563 Most Valuable Professional