However, there is also getContentWindow in Client API that helps is to achieve this.
Let's take a look at how it works.
Create a Web Resource as Below, Add add it to any entity (e.g Lead)
Adding Web Resource to form.
Now we need to pass FormContext to Web resource from Lead Entity.
Create a javascript as below and attach "form_onload" on Load of the form (Make Sure you mention web resource name properly).
Code snippet for JavaScript
Attach the Javascript function on Load of Entity as below.
All Done, Now let's test this.
So this gives us FormContext in WebResource, without having to use Xrm.Page. Feel free to comment on your experiences.
0 Comments