I have an Angular html page that has script reference to the javascript. In the Javascript I am using Xrm
object to make certain actions like Xrm.webApi.retrieveMultipleRecords
etc..
This Angular Html Web resource is loaded as part of SiteMap. The Angular Html web resource also have script reference to "ClientGlobalContext.js.aspx" and able to access Xrm
object.
If I remove the aspx script reference the Xrm
object is undefined. Microsoft docs mention that this script reference doesn't make the Xrm
object available but in my case it's exactly what it is doing.
Then I tried removing the "ClientGlobalContext.js.aspx" reference and started using parent.Xrm
object and everything seems to be working fine again. But the Microsoft docs again said that parent.Xrm will not work if loading an HTML web resource as part of SiteMap which exactly is my scenario and seems to be working.
So need to know what I should do as I don't want to use any methods that's going to be deprecated.
Here is the link to the Microsoft docs: Screenshot of the issue
https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/getglobalcontext-clientglobalcontext.js.aspx