
I have tried loading the formcontext on the form load and set the function in the html webresource, but its not hitting the function in HTML webresoure on the load of html webresource?
Am I missing some thing here that I need to consider?
JS onload - registered on the form load
function LoadFormcontext_Verifyasset(executionContext) {
var ControlName= “WebResource_verifyasset”;
var formContext = executionContext.getFormContext();
var Control = formContext.getControl(ControlName);
if (Control) {
Control.getContentWindow().then(
function (contentWindow) {
console.log(formContext);
contentWindow.setcontext(xrm, formContext);
}
);
}
}
IN HTML with in the script tag
function setcontext(xrm, formContext) {
alert(formContext.getAttribute(“gts_mode”).getValue());
}
Hi Vamsi,
Is the above issue reproducible on any particular version on D365 CRM instance? Have you tried below sample code suggested in the article - https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/getcontentwindow.
Let me know if this resolves the issue in UCI.
Hope this helps.
Regards,
Sanjana