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 :
Customer experience | Sales, Customer Insights,...
Answered

How to get a record Id from external js

(0) ShareShare
ReportReport
Posted on by 645

I'm using an external JS for a custom button on my form and when I want to get fields data I use this - parent.window.Xrm.Page.getAttribute()  what can I use if I want to get the current record guid ?

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to get a record Id from external js

    Hello,

    You can use something like

    parent.window.Xrm.Page.data.entity.getId()

  • Suggested answer
    Fubar Profile Picture
    2,756 on at
    RE: How to get a record Id from external js

    If what you are actually trying to get the id of a lookup attribute then add   .getValue()[0].id

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 125

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 101 Super User 2025 Season 2

#3
Erin Lubben Profile Picture

Erin Lubben 57

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans