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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
iampranjal Profile Picture

iampranjal 41

#2
Martin Dráb Profile Picture

Martin Dráb 38 Most Valuable Professional

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans