Skip to main content

Notifications

Announcements

No record found.

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 ?

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: CRM Plugins For Related Entities

    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

  • Suggested answer
    Ankit Sabharwal Profile Picture
    on at
    RE: CRM Plugins For Related Entities

    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

  • AlxKpk Profile Picture
    10 on at
    RE: CRM Plugins For Related Entities

    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.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 83

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 78 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans