
Hi All
The company hopes to remove some functions that have been abandoned in the current version and replace them with the latest code .
But I noticed that use the executionContext.getFormContext() Instead of xrm.page.getgetAttribute method, I need to use executionContext as input parameter.
When I check the current JScript , I find the following code :
At present, sunRiseCo.util.attribute.get() is used in lots of pages , If i want to replace the Xrm.Page.getAttribute(attr) without change the input parameter of the getAttr() fuction, Is there any solution ?
Hello BlueinLife,
Effectively you will need to adjust the Function that is called on the form to statically assign formContext, something along the lines of:
sunRiseCo.util = function () { var formContext; // This function is called via onLoad on the form function onLoad(executionContext) { formContext = executionContext.getFormContext(); } function getAttr(attr) { var attrObj = formContext.getAttribute(attr); // etc. replace Xrm.Page with formContext from here. }}I hope this helped!