Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Tracking Add/Remove Actions in a Sub-Grid

(1) ShareShare
ReportReport
Posted on by 10

Hello,

 

Is it possible to track user activities on a sub-grid, such as adding or removing a record? I’m open to using client-side JavaScript or plugin code if needed.

 

Thank you very much in advance for your help.

 

Best regards,

Junbin Duan

 
Categories:
  • JunbinDuanCFIA Profile Picture
    10 on at
    Tracking Add/Remove Actions in a Sub-Grid

    To @Tom_Gioielli

     

    Hi Tom,

     

    I've found a solution — the issue can be resolved by adding a plugin that handles the Associate/Disassociate message.

     

    Thank you for your help!

     

    Best regards,

    Junbin

     
  • JunbinDuanCFIA Profile Picture
    10 on at
    Tracking Add/Remove Actions in a Sub-Grid

    Hi Tom,

     

    Thank you for your response and help.

     

    It’s an N:N relationship, and the audit history alone isn’t sufficient. That’s why I need to write code or scripts to track and report changes—specifically when records are added or removed (associate or disassociate actions).

     

    Best regards,

    Junbin

     
  • Verified answer
    Tom_Gioielli Profile Picture
    1,680 on at
    Tracking Add/Remove Actions in a Sub-Grid
    It depends on what type of tracking you are looking to do, and the relationship type being used by the subgrid. If this is a One-to-Many relationship, then adding a record to the subgrid is easy to verify as there is now a record in the child table. Removing is harder to track, provided the user is deleting the record, as there is no history directly in CRM once deleted.
     
    Many to Many relationships are harder, since the records they create are much more hidden and difficult to find.
     
    Depending on what you need to track or so, you could look at creating a custom audit table for the records/relationships in question. When a record is added, you can use a real-time workflow to create a new audit record. Similarly, you can use a real-time workflow prior to the delete action to capture this change as well. This would work fine for the One to Many situation.
     
    The Many to Many tables can't be access by D365 workflows, so you are stuck to using Power Automate or plugins to capture the actions being taken. The same concept applies, however, in that you can trigger a flow or plugin step to run on create or delete of the relationship record for auditing purposes.
     
     
    Above is an older, but good blog, discussing how Many to Many relationships work in CRM and how you can query/access the records.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans