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?
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.
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.'
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?
André Arnaud de Cal...
291,996
Super User 2025 Season 1
Martin Dráb
230,853
Most Valuable Professional
nmaenpaa
101,156