Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Update child entity fields from Parent entity

Posted on by 60

I am trying to update values of a child entity from a parent entity ( statusreason value from opportunity)

If the statusreason value of opportunity is ____

    update another status field in the child entity (which is a custom entity) as ______

I couldn't do using workflow because my custom entity is not displayed in the related entities list.

I didn't use microsoft flow because i don't want to trigger the opportunity entity every time someone changes the opportunity form.

Please suggest me best solution or any sample code.

*This post is locked for comments

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Update child entity fields from Parent entity

    You can write a plugin that trigger on Set state (Status Change) of opportunity.

    You also can go for custom workflow assembly.

  • Suggested answer
    Kalpavruksh D365 CoE Profile Picture
    Kalpavruksh D365 CoE 2,545 on at
    RE: Update child entity fields from Parent entity

    Hi,

    The best solution is to go with the custom plugins.

    There is another approach by using a workflow. However, we don't recommend this but if you don't have any expertise in plugins then you can go with this approach.

    Create a workflow on the child entity

    • Workflow properties
    • Scope organization
    • Run as a child workflow
    • Run on create
    • A background workflow

    Workflow steps

    • Select wait until condition and select the parent entity with a status filer condition.
    • Inside the wait condition. Change the status of the child entity.
    • Call Child workflow and select the current workflow
    • Stop the current execution.

    Description

    The workflow will run on the creation of the child records and wait until parent entity status change.

    It will perform the required functionality and wait again for the next update.

    Disadvantages

    If you have many child records then system jobs will slow down gradually. The number of waiting jobs will affect system performance.

    If found useful, please mark this answer as verified.

  • Suggested answer
    Rajesh Chungath Profile Picture
    Rajesh Chungath 465 on at
    RE: Update child entity fields from Parent entity

    You required custom implementation

    Source Code: github.com/.../Dynamics365v8

    Instructions: github.com/.../Update%20Child%20Records.md

    www.thrives.be/.../run-workflow-on-child-records

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Update child entity fields from Parent entity

    Hi,

    You can go with custom plugin or custom workflow for your requirement.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans