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 :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

Window.opener.Xrm.Page is not working on HTML webresource on UCI

(0) ShareShare
ReportReport
Posted on by 30

Hello All,

We are using Window.opener.Xrm.Page on html web resources to get fields from the form and it is not working on UCI can you please suggest me alternate approaches for  Window.opener.Xrm.Page?

I believe Window.opener.Xrm.Page is going to deprecate but I am not sure on it, can someone confirm on that as well?

Thanks!

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    An HTML web resource added to a form can’t use global objects defined by the JavaScript library loaded in the form. An HTML web resource may interact with the Xrm.Page or Xrm.Utility objects within the form by using parent.Xrm.Page or parent.Xrm.Utility, but global objects defined by form scripts won’t be accessible using the parent. You should load any libraries that an HTML web resource needs within the HTML web resource so they’re not dependent on scripts loaded in the form.

    docs.microsoft.com/.../webpage-html-web-resources

    Please mark my answer verified if i were helpful

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Partner,

    Window.opener.Xrm.Page is deprecated in UCI now, and if you want to get the opener form context, you could use "Xrm.Utility.getPageContext();"

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-utility/getpagecontext

    https://butenko.pro/2020/09/15/js-how-to-get-the-originating-record-reference-in-the-form-script-of-the-quick-create-form/

    Best Regards,

    Leo

  • Suggested answer
    Pankaj Gogoi Profile Picture
    3,177 on at
  • Yasaswini Uppala Profile Picture
    30 on at

    Hello Leo,

    Thanks for the solution, I have tried using Xrm.Utility.getPageContext(); but I am unable to get the required option set fields from my form onto my html page.

    I am opening an HTML web resource on click of my form button and want to send my form field drop down values to it. Any suggestions?

  • Yasaswini Uppala Profile Picture
    30 on at

    Hello Pankaj,

    I have implemented the steps mentioned in this blog and tried to get my form values(drop-down) onto my html page using getContentWindow but unable to achieve it, may be because of opening my html page on click of button?

  • Suggested answer
    Pankaj Gogoi Profile Picture
    3,177 on at

    You can refer this article to pass data to Web Resource

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/sample-pass-multiple-values-web-resource-through-data-parameter

    Best Regards

    PG

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Partner,

    You could pass formcontext as  paramater to html web resource by ribbon work bench, please refer to the following link.

    community.dynamics.com/.../getting-dynamics-365-formcontext-from-ribbon-workbench

    Regards,

    Leo

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 > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 55 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 25 Most Valuable Professional

#3
Soundari Profile Picture

Soundari 15

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans