Skip to main content

Notifications

Announcements

No record found.

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 ?

  • Suggested answer
    Fubar Profile Picture
    2,752 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

  • 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()

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 78 Super User 2025 Season 1

#3
Sahra Profile Picture

Sahra 43

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans