Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

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

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,319 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,319 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans