Skip to main content

Notifications

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
    Wahaj Rashid 11,321 on at
    RE: window.parent.Xrm.Page.getAttribute("").setValue();

    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)

  • Abhilash M abi Profile Picture
    Abhilash M abi 595 on at
    RE: window.parent.Xrm.Page.getAttribute("").setValue();

    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
    Wahaj Rashid 11,321 on at
    RE: window.parent.Xrm.Page.getAttribute("").setValue();

    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/

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans