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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to prepopulate fields from another entity...

(0) ShareShare
ReportReport
Posted on by 26

Hello, I have a parent entity called A.  I then have 2 entities below A that are called B and C.  B and C are children of the Parent entity A.  So B and C are side by side in the hierarchy.  I need information from Entity C to populate in Entity B when Entity B record is created.  I do have a lookup on Entity B to Entity C record and I have mapped the fields over correctly, but I get nothing showing up on Entity B record when it is created.  I could have many Entity B records tied only 1 Entity C record.  I would never have multiple Entity B records tied to multiple Entity C records.  There would always just be 1 Entity C record active at a time.  Can this be done?  If so, what am I doing wrong?

Hope this makes sense, thank you.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Shidin Haridas Profile Picture
    3,497 on at

    Hi USA80,

    If you have set the OOB field mappings, then, for them to kick in, you need to go to the the Entity C record -> sub-grid / related records which show all entity B records, and then click on '+'.

    This will open up a new Entity B record with the values mapped from Entity C.

    Alternately, you can always have form script (javascript), which checks if the new Entity B record has a value in the Lookup C, and maps values from record C to record B.

  • USA80 Profile Picture
    26 on at

    Since entity B and C are siblings of entity A, the user would never go into Entity C and then create Entity B.  I need it so the fields in entity C autopopulate the fields in Entity B without having to go through C to create B.  Sounds like a JavaScript is the way to go here, but I am not sure how to start that...any ideas?

  • Suggested answer
    Shidin Haridas Profile Picture
    3,497 on at

    If the user does not go into entity C, then the OOB mappings will not help you.

    And when you create a B record from A, how do you know which C record to map the values from?

    As you said, record A can have multiple C records.

    So, you can have a JavaScript function 'on change' of the lookup C on the form of record B.

    Basically, it queries the CRM DB for the values from record C and populates them into record B.

    Use the 'CRM Rest Builder' tool to help you with creating the javascript code that helps to retrieve values from record C.

  • USA80 Profile Picture
    26 on at

    There will ever only be 1 C record active at 1 time.  However, there could be multiple B records open at one time.  Since there is only 1 C active record, that would be the record that gets tied to the B record everytime.

  • USA80 Profile Picture
    26 on at

    Where would I find the CRM Rest Builder tool?

  • Suggested answer
    Shidin Haridas Profile Picture
    3,497 on at

    So, you basically are trying to have a 1:1 relationship between A & C, is that right?

    This is where you can download the managed solution from -> CRM REST BUILDER

    Here are some links which show how to use the tool -

    http://www.toplinestrategies.com/blogs/crm/crm-rest-builder-useful-tool-working-crm-2016%E2%80%99s-web-api
    https://community.dynamics.com/crm/f/117/t/255440

    If this answer helps you, please mark it as verified.

    Cheers!

  • USA80 Profile Picture
    26 on at

    A is the parent entity.  B & C are the child entities.  The users will go through A to create a B record.  The B record has a lookup to the C record.  I need the information of some of the fields from the C record to auto populate into the B record.  There will only ever be 1 active C record.  So my relationships are from A to B a 1 to Many.  From B to C a 1:1 and from C to B a 1:M.

    Hope that makes sense

  • Suggested answer
    Michael Ual Profile Picture
    on at

    This can be accomplished with an OOB workflow.

    Workflow entity: Entity B

    Triggers on: Create or Update (Field: Lookup to Entity C)

    Condition: Lookup to Entity C contains Data

    Action: Update Record (Entity B)

  • Suggested answer
    SCV Profile Picture
    1,004 on at

    As Michael mentioned you can use a OOTB workflow to achieve this and data from entity C will be populated on save of the entity B record. If your expected behaviour is to populate the entity C data on entity B record before saving entity B record (let’s say these fields are mandatory and then you can’t save the record without data) you need to trigger a JavaScript on change of the entity C lookup on Entity B form and get the data and show on entity B fields. As mentioned in previous comments building the query to get the data is easy with REST builder. You need to pass the GUID of the entity C lookup and get the fields.

  • USA80 Profile Picture
    26 on at

    Everytime I try and go into the REST Builder solution it just says Please Wait and it sit there.  Am I doing something wrong?

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans