Notifications
Announcements
No record found.
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!
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
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
Try using the getContentWindow method.
https://www.inogic.com/blog/2020/08/how-to-use-xrm-and-formcontext-in-html-webresource-in-dynamics-365-crm/
PG
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?
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?
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
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,
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Tom_Gioielli 55 Super User 2025 Season 2
Daniyal Khaleel 25 Most Valuable Professional
Soundari 15