Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

AutoSet Data field in child entity from parent entity using Plugin

(0) ShareShare
ReportReport
Posted on by 105

Create option set ‘Member Type’ having values VIP, Govt. Employee, Professional, Student & option set ‘Priority’ having values High, Medium, Low.
Use ‘Member Type’ option set on Account & ‘Priority’ option set on Contact.
Create an intermediate entity to set priority of each member type.
Task is to auto set the ‘Priority’ of Contact depending on ‘Member Type’ of Account.

  • Rits Profile Picture
    Rits 105 on at
    RE: AutoSet Data field in child entity from parent entity using Plugin

    Thanks ,it is solved.

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: AutoSet Data field in child entity from parent entity using Plugin

    HI,

    Yes.

    We can map field from parent entity to child entity when we create a child record using mapping in relationship behaviour. But your requirement is different.

    docs.microsoft.com/.../map-entity-fields

    Mapping will work only if Field data type, optionset values are same. But as per your requirement you need get the data from intermediate entity based on Memeber Type.

    Please mark my answer verified if i were helpful

  • Rits Profile Picture
    Rits 105 on at
    RE: AutoSet Data field in child entity from parent entity using Plugin

    Thanks Bipin..

    Can you please elaborate do i have to create 2 plugins one for account another for contact

  • Verified answer
    Bipin D365 Profile Picture
    Bipin D365 28,961 Moderator on at
    RE: AutoSet Data field in child entity from parent entity using Plugin

    Hi,

    You can register your plugin on Post Update of Account Entity. Select Member Type in Filtering Attributes.

    Plugin should get value of Member Type from Context ->Query Expresson/fetchXML to get Priority from intermediate entity based on Member Type value.

    Fetch All contact records based on Account ID then loop thorugh these records and update contact with priority optionset.

    Make sure you create new contact entity object to update priority. Do not use same entity which you get while fetching child contacts based on Account. This will ensure you only update Priority field on Contact.

    You may have to create another plugin on Contact- When Contact gets created in system associated to Account then you should update Contact record Priority value from Parent Account member type intermediate entity.

    Please mark my answer verified if i were helpful

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans