web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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

    Hello,

    You can use something like

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

  • Suggested answer
    Fubar Profile Picture
    2,761 on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Manoj - ManoVerse Profile Picture

Manoj - ManoVerse 77 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 43

#3
Chris1968 Profile Picture

Chris1968 20

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans