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());
}