Hi,
I have a requirement where I have to know the name of the user who deleted the record from a sub-grid.
I have 2 custom entity Credit and Credit Details. The scenario is like if user deletes the record from the Credit Details sub-grid which is in Credit entity. I should either get an email that a record was deleted or have some auditing enabled for deleted records in the sub-grid. Also, deleting the records just removed the records from sub-grid not from the entity.
The records which are getting populated in the sub-grid are fetched from Account entity.
@Note: I don’t have a restrict a user from deleting records. Just need audit enabled for sub-grid.
Regards,
Verma
*This post is locked for comments
Thanks Ravi, this issue has been resolved now your comments help getting the solution.
Hi,
When you hit delete in subgrid which has 1:N relationship, it will actually delete the record.
In this case, if you have the Auditing enabled, you can see the details of the record deleted and who deleted it. If you want to send email, you can write a plugin on delete message of you entity and check the InitiatingUserId and then send an email.
When you delete the record which has N:N relationship, it will remove the association and keep the original record as is. In this case, you can write a plugin on disassociate message and perform your logic.
community.dynamics.com/.../capture-associate-disassociate-events-in-plugins
You can read about subgrid behaviour here: community.dynamics.com/.../capture-associate-disassociate-events-in-plugins
Hope this helps.
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6