Move from using Xrm.Page to formContex in UCI form based PowerApps WebResources
The usage of Xrm.Page is currently deprecated, still available due to it’s high usage, but still deprecated. When will it go away, we don’t really know yet. How then can we use it’s formContext replacement within a web resource. Well Microsoft recently added a the getContentWindow() function to the context which allows us to get the actual content of a web resource. By adding an onload function to our form and utilizing getContentWindow() we can now call javascript on our web resource and pass it the formContext. Additionally you can add the context to the window object of the web resource so that the formContext can be used throughout the lifecycle of the web resource. Here is a quick tutorial on how to pass the formContext to a WebResource on a UCI Form. formContext in WebResource Form OnLoad Code // This should be in a script loaded on the form. // form_onload is a handler for the form onload event. function form_onload(executionContext) { var formContext = executionCon...