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)

Get the lookup field guid so I can set the value from javascript

(0) ShareShare
ReportReport
Posted on by

So I currently have a API which does address validation and the account form contains a state lookup control. I want to be able to change the state lookup value from my API result, however I need the GUID of the state lookup field I'm trying to change to. I currently have a array of GUIDs hardcoded to the state lookup fields and this isn't a robust solution. How can I get GUIDs of the lookup fields so I can change the values? Example: The value GA is the value displayed before the api call and than it returns FL. I cant set the value of FL because I don't have that lookup field guid but I have the guid of GA.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Get the lookup field guid so I can set the value from javascript

    Hello,

    I believe that you created custom entity that contains the list of your states. Based on this assumption I can suggest to build JavaScript code that will retrieve state based on the name using WebApi. To make it faster you can use RestBuilder tool - github.com/.../2.5.0.0

  • Suggested answer
    prt33k Profile Picture
    6,907 on at
    RE: Get the lookup field guid so I can set the value from javascript

    Hi,

    You need to make webAPI call to retrieve the GUID of FL from CRM and then set it. Something like this will help:

    community.dynamics.com/.../ms-crm-2016-web-api-operations-retrieve-single-or-multiple-records

    Thanks,

    Prateek

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans