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 :
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

I have the same question (0)
  • Suggested answer
    Pawar Pravin  Profile Picture
    5,237 on at

    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/.../

  • Community Member Profile Picture
    on at

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

  • Community Member Profile Picture
    on at

    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.

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    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

  • Dushy Profile Picture
    5 on at

    Thanks mam

  • Dushy Profile Picture
    5 on at

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

  • Suggested answer
    Community Member Profile Picture
    on at

    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.

  • Community Member Profile Picture
    on at

    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.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans