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 365 | Integration, Dataverse...
Suggested answer

How to access Parent entity Form field using Javascript

(0) ShareShare
ReportReport
Posted on by 247

Hello,

I have a requirement to work on the fields of the parent form on child entity form. The requirement is while working on the child entity form I have to access the values of some field which are available on the parent entity form using JavaScript. 

Shoudl I use the window.parent.Xrm.Page.getAttribute() or it is deprecated now. Is there any other alternative way to access the field of the parent form. Please suggest me some solution.

Thanks

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: How to access Parent entity Form field using Javascript

    Hi,

    You need to use CRM.webapi

    docs.microsoft.com/.../retrieverecord

    I hope you have lookup field on child entity pointing to parent Entity record.

    Thanks,

    Bipin

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: How to access Parent entity Form field using Javascript

    Hi AR,

    Yes, you could use the retrieveRecord() function to get the parent record by parent record id. However, pay attention to this scenario:

    Open a parent main form and modify some fields(Not Save) and then create child record by using quick create form. 

    In this scenario, the fields you modified on the parent main form are not saved. When you use retrieveRecord() function to get the parent record, it would get the original data. So if you want to get the modified value of field, you would better use window.parent.Xrm.Page.getAttribute() to get them. Although window.parent.Xrm.Page.getAttribute() is not supported.

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 83 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 57 Most Valuable Professional

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 52 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans