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

Xrm.Page.getAttribute("lookupField").getValue()[0].id retrieve Name attribute instead Guid

(1) ShareShare
ReportReport
Posted on by 13
 Hello, please tell me what could be wrong.
On one of the environments, the function for getting the guid for the lookup field stopped working. Instead of the ID, I get the name. On another environment all fine.

How can this be fixed? I tried the option through XRM  and FormContex. The result is the same
 
please check my screenshot, pay attention on nav_parentaccountid, problem only with this custom entity, with other entity there is everything works fine
I have the same question (0)
  • Ray Profile Picture
    1,537 on at
    Is nav_parentaccountid a Virtual Entity? Or any customize code on it?
    The normal lookup field does not have so many property return in getValue():
  • CU22081016-0 Profile Picture
    13 on at
    hello Ray, thx for your question.
    nav_parentaccountid it is lookup field to custom entity (not virtual entity)
     
    yes I have several customization in this field but all of them stopped working. 
    var formContext = executionContext.getFormContext();
        var parentContractId = formContext.getAttribute("nav_parentcontractid").getValue()[0].id; //here I got name record, not ID of record
     
    also I found that this bug is present only when saving a new record. When I'm trying update record - all works fine
  • Suggested answer
    CU22081016-0 Profile Picture
    13 on at
    I figureout.... 
    It was my fall, I did custom view and did
    layoutXML = "<grid name='resultset' object='1' jump='nav_number' select='1' icon='1' preview='1'>" +
                "<row name='result' id='nav_name'>" + //should be  nav_contractid
                "<cell name='nav_number' width='150' />" +          
                "<cell name='nav_signedon' width='150' />" +
                "<cell name='nav_startdate' width='150' />" +
                "<cell name='nav_enddate' width='150' />" +
                "</row>" +
                "</grid>";
  • Vahid Ghafarpour Profile Picture
    12,147 Super User 2025 Season 2 on at
    So it can be any field?
    Interesting

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 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans