Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

how to get related field of an entity from lookup id in dynamics CRM without API

(1) ShareShare
ReportReport
Posted on by 5

how to get related field of an entity from lookup id in crm without api

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to get related field of an entity from lookup id in dynamics CRM without API

    Hi Partner,

    Can you click Yes under "Did this answer your question?" to close this thread if your problem has been solved.

     pastedimage1610505770981v1.png

    Thanks. 

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to get related field of an entity from lookup id in dynamics CRM without API

    If its a lookup, say Account, and you want data from it to appear on its child - Contact.  You can do a real time workflow as well (or background).  You can reach one level up from OOB workflows.

  • Dushy Profile Picture
    Dushy 5 on at
    RE: how to get related field of an entity from lookup id in dynamics CRM without API

    Thanks, actually no I don't have any particular reason. I just wanted to know whether it is possible or not.

  • Dushy Profile Picture
    Dushy 5 on at
    RE: how to get related field of an entity from lookup id in dynamics CRM without API

    Thanks mam

  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 1,014 Super User 2024 Season 2 on at
    RE: how to get related field of an entity from lookup id in dynamics CRM without API

    Hi Dushyant agre,

    You will need to use an API such as Xrm.WebApi.retrieveRecord in order to achieve this. Is there a particular reason you do not want to use an API?

    The following example demonstrates how to retrieve the contact for an account record with record ID = a8a19cdd-88df-e311-b8e5-6c3be5a8b200. For the related contact record, we are only retrieving the contactid and fullname properties. You can adapt this code to meet your requirement.

    Xrm.WebApi.retrieveRecord("account", "a8a19cdd-88df-e311-b8e5-6c3be5a8b200", "?$select=name&$expand=primarycontactid($select=contactid,fullname)").then(
        function success(result) {
            console.log("Retrieved values: Name: "   result.name   ", Primary Contact ID: "   result.primarycontactid.contactid  
                    ", Primary Contact Name: "   result.primarycontactid.fullname);
            // perform operations on record retrieval
        },
        function (error) {
            console.log(error.message);
            // handle error conditions
        }
    );

    The above example displays the following in your console; you might see other values depending on your data:

    Retrieved values: Name: Adventure Works, Primary Contact ID: 49a0e5b9-88df-e311-b8e5-6c3be5a8b200, Primary Contact Name: Adrian Dumitrascu

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to get related field of an entity from lookup id in dynamics CRM without API

    Hi Dushyant,

    Maybe you can use power automate to retrieve parent entity based on lookup field in child entity form.

    For example, I have a custom entity, it is N:1 relationship with account entity.

    pastedimage1609899863211v1.png

    1.Go Power Automate(https://us.flow.microsoft.com/en-us/ )

    Set ‘When a record is selected’ as trigger, you can select other trigger based your needs.

     pastedimage1609900144482v2.png

    2.Add ‘Get record’ action to get parent entity record(Account).

    pastedimage1609900255661v3.png

    3.Then you can get any fields of the parent records, and use them to do any operations you need.

    For example, I get account name field value of account with using ‘compose’ to test.

    pastedimage1609900700086v5.png

    Test Results:

    pastedimage1609900627357v4.png

    And it is just simple example, you can provide more detailed information if it can’t help you.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to get related field of an entity from lookup id in dynamics CRM without API

    Can you provide more detail on what you are trying to accomplish and the layout of the data (parent/child relationships)

  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: how to get related field of an entity from lookup id in dynamics CRM without API

    Hi Dusyant,

    As per my  information there is no way to retrieve value without using API in JS.

    Please refer below url for more details:

    community.dynamics.com/.../retrieve-value-of-lookup-field-from-another-entity

    carldesouza.com/.../

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans