web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

GetContentWindow not hitting the function in webresource

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    Sanjana Ramesh Profile Picture
    on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
iampranjal Profile Picture

iampranjal 45

#2
Martin Dráb Profile Picture

Martin Dráb 38 Most Valuable Professional

#3
Satyam Prakash Profile Picture

Satyam Prakash 35

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans