Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

field mapping on 2 Entities

(0) ShareShare
ReportReport
Posted on by

I have field mapping on 2 Entities

Entity: Organization - Role (Custom Entity)
Fields: Org Name mapped to Org name (1:N)

Now when creating a record on the Role entity, the name of the field neatly gets filled in the Role record from the related Org field. Now what I want is to have a workflow triggered on the Role record when the Org name changes in the Org record. But when I change the record, the mapped field on the Role entity doesnt change along with it. So it seems to be filled only once at creation and after that is not dynamically changed when changing it on the related record.

Does anyone have any experience with this?

*This post is locked for comments

  • RE: field mapping on 2 Entities

    tw0sh3ds

    Thank you for explaining that. So it confirms what I thought, and good to know it will not even work with imports or SDK solutions.

    I have tried to use a calculated field but it seems I am still missing a step since it still fills the field only once and doesn't update on change on the related Entity. So it takes the initial Organization name on the Role Record. But when changing the org name on the Org record, it doesnt change along on the Role record.

    The problem is that I cannot create a workflow since it is a 1:N so it can create a Role but not update an existing related role.

    I have no experience yet with creating a plugin.

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: field mapping on 2 Entities

    JS code is written to implement these kind of requirement, you can check our sample here :http://himbap.com/blog/?p=2874 but you can change it for your requirements

  • Suggested answer
    Karsten Wirl Profile Picture
    Karsten Wirl 4,477 on at
    RE: field mapping on 2 Entities

    Hello Robert.

    That's the default behaviour of mappings. It works only on create event and by using workflows or the forms... JavaScript. If you create your records via plug-ins, the mappings will not work. In this case you have to copy the mappings in your plug-in.

    Kind regards,

    Karsten

  • Suggested answer
    Radu Chiribelea Profile Picture
    Radu Chiribelea 6,667 on at
    RE: field mapping on 2 Entities

    Hi Robert,

    I think this is by design - the mapping works only on create, when creating a child record out of the context of a parent record.

    However - how is your mapping defined? Are you using a look-up field, that points towards the Org? Or is it a simple text field that just holds the Organization name? If it is a look-up field, then the name should be updated automatically, as the lookup holds a reference towards the record (and not the name itself).

    Maybe you can add some print screens of your set-up, to help better understand.

    If it is a text field, you can achieve this  by a plug-in triggered on the update of the parent record- where the triggering field is the name

    The logic of the plug-in should be following:

    1. Get the id of the Organization from the execution context

    2. Create a Retrieve Multiple Request that searches all the child records where the OrganizationId is the one from the Execution Context.

    3. Iterate through the results of the RetrieveMultiple Response and update all the entities of the Entity Collection.

    Hope i understood your question correctly.

    Regards,

    Radu

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: field mapping on 2 Entities

    It will not change, this is not how mapping works. It will only map the value when you create the record and the mapping is done purely in JavaScript, so if you create your record using SDK or import or anything else, you will not get any use of that mapping. There are many solutions here - you can create a custom plugin/workflow to populate this value when it changes, or create a Calculated field, instead of normal one, that will take value from parent entity.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,436 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans