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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

window.parent.Xrm.Page.getAttribute("").setValue();

(0) ShareShare
ReportReport
Posted on by 595

Hi All, I have a requirement that I'm using HTML "navigateTo" web resource. I have a text field in HTML web resource that I need to update a form field using Webresource "window.parent.Xrm.Page.getAttribute("").setValue();" I have used above function. Getting cannot read null error.

Please help to achieve this

  • Suggested answer
    Wahaj Rashid Profile Picture
    11,323 on at

    Hi,

    Thank you for your query.

    window.parent.Xrm is not supported.

    Please use formContext in the Web-resource.

    Here is a very nice tutorial on this:

    https://carldesouza.com/how-to-use-formcontext-in-a-web-resource-in-dynamics-365-power-apps/

  • Abhilash M abi Profile Picture
    595 on at

    I tried but didn't work for me. Maybe because I'm using navigateTo to call web resource as a POPUP window.

  • Suggested answer
    Wahaj Rashid Profile Picture
    11,323 on at

    Hi,

    In this scenario, it is better to pass data (as parameter) in the NavigateTo function:

    pastedimage1623221277362v1.png

    This is an excellent post by Andrew Butenko:

    Xrm.Navigation.navigateTo – gotchas, tricks and limitations – Andrew Butenko's Blog

    Here is another post, which demonstrates how you can use FormContext:

    Get formContext inside Webresource in Dynamics 365 - Debajit's Power Apps & Dynamics 365 Blog (debajmecrm.com)

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 August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 61 Super User 2026 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 34 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 24 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans