Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to auto populate field based on entity lookup?

Posted on by Microsoft Employee

I have an Account entity and Contact entity. In the Account entity form, I have a field called Account Type. In the Contact entity form, I have an Account entity lookup field. When I select an Account there, I would like another field to be shown in the Contact entity form to populate with the Account Type previously entered from the Account entity form. I can't believe there isn't an easy solution to auto populate this. I am ready to try coding if needed, but need some help!

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to auto populate field based on entity lookup?

    Got it, that answers my question. Thanks!

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to auto populate field based on entity lookup?

    Hi jsj2012,

    You won't be able to achieve your requirement (i.e display phone calls from either contact or account) in a single view. The group or condition is only applicable for an entity and doesn't cross over to other related entity.

    You need to have 2 views i.e 1 for contact and 1 for account.

    Also, in that view, you put the filter to Activity Party(Account)..did you mean Regarding (Account)? How are you creating the phone call record. Can you share a screenshot.

    The workaround to display such phone calls is to have a field in phone call itself which you will set on create of a phone call and then used just that filter in your advanced find query.

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to auto populate field based on entity lookup?

    Guillaume,

    How would I create this dynamically filtered view using FetxhXML? I am new to this, so any detailed instructions will help! Where do I put the code? And how do I change the code based on my fields? Thanks!

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to auto populate field based on entity lookup?

    Hi,

    no you can't do that with the OOTB Filter criteria. You will need to create a dynamically filtered view using FetchXML. Then in this FetchXML you will have th possibility to achieve what you are asking for.

    community.dynamics.com/.../228487

    community.dynamics.com/.../224671

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to auto populate field based on entity lookup?

    To confirm, I am on the Account Type field in the editor, and the data type is the same as the Account Type field in the Account entity. The data type is Option Set. I found an alternative solution though, but haven't solved my ultimate dilemma. I just changed the data type to Single Line of Text, and then was able to auto-populate that field in the workflow editor with the Account Type from the Account entity.

    My larger problem is that I am trying to set up a custom View in the Phone Calls entity, and I want the calls to be filtered based on what type of Account Type is selected in the Account entity. The Phone Calls entity pulls in either an Account or Contact.  Now the Account entity and Contact entity both have the same Account Type, and I need to add filter criteria to my custom view that says pull in this phone call if the Account or Contact associated with equals Account Type 1, Account Type 2, Account Type 3, or Account Type 4. I thought I could group the Account and Contact options together in the filter criter editor, but it looks like I can't?

    7043.Capture1.PNG

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to auto populate field based on entity lookup?

    This could be either you are not on the Account Type field in the editor i.e. not selected that field or the data type is not same as the account type field in Account entity.

    Can you try this and confirm please?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to auto populate field based on entity lookup?

    Getting closer. I got it to work when I set the Account Type field to auto-populate a random field in the workflow editor form, but when I try to set it to the new Account Type field I just created (which is an option set), the workflow editor doesn't give me the ability to set the Account Type. In the screenshot below, the yellow dropdown area is empty when I have the new Account Type field selected on the left. 

    8688.Capture.PNG

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to auto populate field based on entity lookup?

    Hope you have set it to trigger it on create & on field change.

    Also, within the workflow editor, you need to add the step to update the contact. click on the properties, this will open the form for you to set the values. You then need to click on the account type field and then from right side, select the value from the Company Name.

    If this still doesn't work, can you share a screenshot of your workflow and the properties displaying the account type field?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to auto populate field based on entity lookup?

    I was able to add the Quick View, but to your point, I need the Account Type field to be a field in the Contact entity itself so that I can reference it from there later.

    I just added Account Type as the same field to my Contact entity (it has a new id name called "new_accounttype") and the data type, values, options, etc. are exactly the same. How do I set this up in the workflow? I tried following the steps from your link, Ravi, but it's not populating when I publish and then select an Account from my Contact form.  

  • Suggested answer
    Syed Ibrahim Profile Picture
    Syed Ibrahim 6,257 on at
    RE: How to auto populate field based on entity lookup?

    In addition to the above suggestions, you can go for field mapping which is no code required to populate the account related information to your contact . You have to just do the mapping of the same account type field. You can follow below link how to

    archive.crm.fullscope.com/save-time-entering-data-into-crm-by-mapping-fields-between-records

    Note: mapping will work only if you are creating accounts associated view or subgrid.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans