web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to delete data for save data per company table using set based operations

(0) ShareShare
ReportReport
Posted on by 20

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?

  • Martin Dráb Profile Picture
    241,637 Most Valuable Professional on at

    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?

  • Arti bharane Profile Picture
    20 on at

    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.'

  • Martin Dráb Profile Picture
    241,637 Most Valuable Professional on at

    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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 271 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 217

#3
Subra Profile Picture

Subra 200 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans