web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Field Mapping in Custom Entity

(0) ShareShare
ReportReport
Posted on by

I have created a custom entity which shares a relationship with the Contact entity.

I have a number of fields on my custom entity form such as Salutation, First Name, Last Name, Address etc. Pretty much the same fields as in the Contact entity.

When the form is loaded I want these fields to be pre-filled with the information from the mapped contact. I have mapped the contactid lookup field which I know works as if I display it on my form, it shows the contact it is linked with however, the other information is not populated.

Is this possible or am I missing something simple ?

Thanks guys.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Wayne Walton Profile Picture
    13,728 on at
    RE: Field Mapping in Custom Entity

    In the relationship you created, there should be a set of fields you can map.  That will let you define what should be pre-populated.  However, be aware, those only work if you create the record FROM the Contact record.  You can create the other record standalone and then relate it to a Contact and expect the fields to come over.

  • Suggested answer
    Joe Woltering Profile Picture
    12,163 on at
    RE: Field Mapping in Custom Entity

    There are a couple of different ways you can handle this, depending on how your custom entity record is being created.

    From the Contact: If you are creating the custom entity record from the Contact record (either via sub-grid or the navigation bar) you just need to set up your field mappings in the 1:N relationship between the Contact and the custom entity. Then when you add a new record it will 'pull' the values from the Contact.

    From Contact lookup field in the custom entity: If you are creating the custom entity record first and then doing a lookup on a Contact field, you can then map the values via a real-time workflow. I'm not sure if Business Rules are able to pull related entity fields' values yet.

  • Community Member Profile Picture
    on at
    RE: Field Mapping in Custom Entity

    Hi Wayne.

    Oh I see. The record is actually created in the Opportunity record which already has a relation to the Contact record.

    So there is no way to get the data into the new record ?

  • Community Member Profile Picture
    on at
    RE: Field Mapping in Custom Entity

    Thanks Joe, I was replying to Wayne as your's came through.

    It looks like I'll have to a workflow as I'm not creating the record from the contact :( I've never used these before so it should be fun.

  • Verified answer
    Aileen Gusni Profile Picture
    44,524 on at
    RE: Field Mapping in Custom Entity

    Hi Henda,

    You cannot get mapping works if you set mapping in the Contact but you create the record through opportunity.

    So, yes, you need a workflow.

    1. Create a workflow on this entity.

    2. It can be triggered onCreate or onUpdate(Contact field is updated)

    3. Then you add steps, add condition if Contact contains data then..

    4. Add step update the Entity record

    5. In the set properties, you just set the fields you need  (salutation, address, etc), then in the right navigation explorer, you can have the related entity properties, you can select from Contact fields.

    6. Set for each field the value you get from Contact in the right.

    Hope this helps!

    THanks

  • Community Member Profile Picture
    on at
    RE: Field Mapping in Custom Entity

    ok, so far so good.

    I've never really worked with workflows so I'm fairly new to this bit...

    I've created a process and set the category as a real-time workflow, I have set the scope to user and I have selected to trigger when the record is created.

    It all works ok BUT I have to enter a new for my new record and click save BEFORE it will update my fields. How can I get it to update the fields when the new record form is opened ?

    Is it one of the other checkboxes ?

  • Aileen Gusni Profile Picture
    44,524 on at
    RE: Field Mapping in Custom Entity

    Hi Henda,

    Workflow is always working after you save it.

    If you want to onLoad then you need to write a javascript to get the Contact fields values.

    Better if you still want to use Workflow, the fields you make it as disable first then after save it will autofill the value so the users will not get confused.

    Thank you.

  • Community Member Profile Picture
    on at
    RE: Field Mapping in Custom Entity

    Hi Aileen, so how do I get the fields to unlock from read-only once the record is created / saved. I have set some business rules on my entity to unlock the fields.

    I have tried using the Status field which contains Active and Deactive but this does not seem to work also the CreatedOn and CreatedBy fields.

    Maybe I am missing something here ?

  • Community Member Profile Picture
    on at
    RE: Field Mapping in Custom Entity

    EDIT: It works using the CreatedOn field IF it is shown on the form, but when its removed the fields remain locked.

    Any ideas how I can get this to work ?

  • Community Member Profile Picture
    on at
    RE: Field Mapping in Custom Entity

    Once the record is saved, I have to close the form and then re-open so the fields become unlocked.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans