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

I have the same question (0)
  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 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,321 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 55

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans