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

Announcements

No record found.

News and Announcements icon
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
    Microsoft Employee 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

#3
ManoVerse Profile Picture

ManoVerse 53 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans