Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Change ownership of child records based on parent record automatically

Posted on by 873

Hello,

I would like to know if the relationship behavior can achieve the below:


If a parent record owner is owner A, then all child records associated with the parent should be owned by owner A. So it inherits the owner assigned of the parent record.

The scenario I am doing is:

The parent record is created by me, as owner B, when I change the parent record ownership to Owner A, I don't want to manually change the related child records to Owner A as it should automatically change the assigned user to Owner A.

In order to accomplish the above, what is the best approach? Can you provide an example?

Any help is greatly appreciated.

Best regards,
EBMRay

  • Suggested answer
    HandeMV Profile Picture
    HandeMV 256 on at
    RE: Change ownership of child records based on parent record automatically

    You have to add it. I would say if you have that many, just create a single plugin which updates current record based on parent and add plugin step for all entities. So there won't be duplicate and you don't need to write it again and again for each entity.

    Please mark this as verified if it resolves your issue.

  • EBMRay Profile Picture
    EBMRay 873 on at
    RE: Change ownership of child records based on parent record automatically

    Hello HandeMV ,

    Thank you for your reply.

    So the only way will be to have a JS/Plugin/Workflow to set the Owner based on the parent record.

    The main pain of this problem is that I have around 196 tables related to that parent entity so I will have to add those JS to all the forms right?

    Appreciate your support.

    Best regards,

    EBMRay

  • Verified answer
    HandeMV Profile Picture
    HandeMV 256 on at
    RE: Change ownership of child records based on parent record automatically

    Hi,

    Exactly, when we change parent record owner, relationships will update child records. If we are creating new child record manually, it always auto populated as user who is creating it.

    If you want to update even while creating, just write javascript on load of form and set Owner field of record as owner of parent record. Then you will always see parent owner in child owner.

    If you don't want it while creating it but as soon as you save it should reflect, then second approach would be, just create run time workflow on create of child record, set owner as owner of parent record. This would be simple approach if you don't want it while creating record.

    If you still have doubts just let me know.

  • EBMRay Profile Picture
    EBMRay 873 on at
    RE: Change ownership of child records based on parent record automatically

    Hello HandeMV ,

    Thank you for providing the documentation.

    As per my testing, I have changed the relationship behavior to the following:

    pastedimage1683555012072v1.png

    Mainly, I have a table called equipment related to another table called equipment testing as 1:N.

    The simulation I did is:

    Struggling-Scenario.gif

    • I changed the current parent owner to the user desired before creating the parent record.
    • While creating the child records it always takes me as the current owner and does not reflect changes according to parent ownership.
    • However, when I change the parent owner to any other owner it reflects in the child records.

    What I am still struggling with:

    Scenario-2.gif

    It should always take the owner of the parent record when I create a child record even if I was a different owner than the parent record.

    Could you please advise what I am doing wrong? I appreciate it if you could provide an example.

    Thank you,
    EBMRay

  • Suggested answer
    Haig Liu Profile Picture
    Haig Liu Microsoft Employee on at
    RE: Change ownership of child records based on parent record automatically

    Hi EBMRay,

    I guess what you want to find out is the cascade rule:

    https://ledgeviewpartners.com/blog/what-are-cascading-rules-in-microsoft-dynamics-365-crm/

  • Verified answer
    HandeMV Profile Picture
    HandeMV 256 on at
    RE: Change ownership of child records based on parent record automatically

    Hi,

    This can be handled by relationship behaviour.

    1. Open Solution and Navigate to Table(Entity) -> Select Relationship of your entities -> Relationship Behaviour.
    2. Change Relationship Behaviour Assign to Cadcade All. This will resolve your problem.

    pastedimage1683270134341v1.png

    Please mark it as verified if this solves your issue. 

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans