I need to access a control of a web resource to refresh it. According to the link below we need to have the form context.
But I am unable to get the form context and couldn't find it anywhere in the documentation on how to access the execution context in the HTML web resources. I have tried registering a function on load of the form and passing execution parameter in it using form properties. Then in the function I am getting it like below with formContext variable as a global variable.
var formContext;
function getFormExecutionContext(executionContext) {
formContext = executionContext.getFormContext();
console.log("Form Context: ");
console.dir(formContext);
}
However when I tried to access this formContext in other HTML web resource placed on CRM form, it says undefined. Can someone please explain how can we get the form context in HTML web resource?
Normally we will include the below snippet in HTML webresource head section, this will present you the CRM context & controls outside CRM form.
Then access the controls like following:
The same should work in v9 as well for backward compatibility, may be not mentioned in documentation.