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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

CRM Plugins For Related Entities

(0) ShareShare
ReportReport
Posted on by 65

Dears,

How to run plugin for parent entity  AFTER Updating field in the child entity through plugin 

Example : 

I have Order , Order details entities. 

there is a plugin running in details which update the total field in the header, after updating the header total there is a plugin to some the Total Order . 

the parenet plugin giving error.

how to impleement this scenario ?

I have the same question (0)
  • AlxKpk Profile Picture
    10 on at

    If you need to run your plugin on a parent record you have to trigger a plugin message (Update, Associate, SetStateDynamicEntity, etc.) on the parent record at least.

    In general I would suggest to trigger both plugins for the Order Details entity as both processes (update total field, summarize total fields) are triggered on the same entity.

    For further questions please also provide the exception details.

  • Suggested answer
    Ankit Sabharwal Profile Picture
    Microsoft Employee on at

    Hy Jasri- We have faced a similar scenario on Opportunity and opportunity products. We have achieved the functionality by firing a plugin on Opportunity product entity. Our scenario was related to update. In this context we got an opportunity id and then we need to retrieve the opportunity and update the desired field on opportunity entity.

    Just make sure you put the context. Depth check if there is any scenario in which you are facing any infinite loop issues.

    These related entities in OOB become sometimes weird to handle.

    If this answer helps you out, please mark this answer verified.

    Thanks,

    Ankit Sabharwal

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Jesri,

    As per my understanding, you want to update the total in order based on totals in Order details. You have two plugins 1st plugin calculates and updates Order detail’s total field and on the change of total field, you update the Parent order total field.

    My Suggestion: Instead of two plugins make it one. If you cannot do that then run your plugin on update/Change of total field in Order details. Fetch parent’s Order details records using fetchxml it might be like the below screenshot.67241.png

    Replace Parent order with your running order detail’s parent order.

    And retrieve those records using service.retriveMultiple.

       var orderDetails = service.RetrieveMultiple(new FetchExpression(fectXml));

     

    here you have a list of all Order details list with parent Id.

    Then calculate and Update whatever field you want in Order or Order Details.

    Note: you already get the parent Order form running order details.

    For further details, you can go through Microsoft documentation

    Docs link: Entity Operations using the Organization service (Microsoft Dataverse) - Power Apps | Microsoft Docs

    For further queries visit:  https://www.solzit.com/ 

    Regards,

    Kirti

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 143 Super User 2026 Season 1

#2
Hamza H Profile Picture

Hamza H 142 Super User 2026 Season 1

#3
11manish Profile Picture

11manish 121

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans