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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to delete related records, when a record is deleted? How to recalculate data after the deletion?

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to ask for an advise on what approach should I use, as I have the following scenario:

After a record (say Assignment) is deleted in the AX 2012, all the related records (say Time Entries) should be deleted, and a complex recalculation should be triggered for another reporting record (containing all the Assignments that are remaining). 

I am new to Axapta and I have a few years experience with CRM.

I will check the Axapta SDK today, but from what I understand, I can have a workflow to delete the related entities, once the Assignment is deleted, but the recalculation might be quite complex to be handled by the workflow itself... so what could I use for it? Or should I use something else instead of a workflow for the entire process?

Thanks.

Best Regards,

Evgeni Dyulgerov

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Florian Hopfner Profile Picture
    2,461 on at

    The deletion scenario you describe is usually done by using delete actions on the tables. These allow you to automatically delete records in related tables.

    For the recalculation, you can add an event handler to the delete method of the assignment table to trigger the recalculation logic.

  • Verified answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Workflow is not suitable in your scenario. Delete action can take care of your fist question. Read more about delete action on below link. Regarding recalculation you can do that in pre event handler.

    docs.microsoft.com/.../how-to-create-delete-actions

  • Verified answer
    Hossein.K Profile Picture
    6,648 on at

    as mentioned , and also event handler:

    www.erpsoftwareblog.com/.../event-handling-in-microsoft-dynamics-ax-2012

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans