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 :
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!

  • Suggested answer
    Bipin D365 Profile Picture
    28,995 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,341 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
  • LeoAlt Profile Picture
    16,341 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 60 Most Valuable Professional

#2
11manish Profile Picture

11manish 23 Super User 2026 Season 2

#3
Travis South Profile Picture

Travis South 14

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans