Notifications
Announcements
No record found.
Facing error "TypeError: Cannot read property 'getFormContext' of undefined" after updating JavaScript files to new
var formContext = executionContext.getFormContext();.
Hi raki,
You need to make sure that you pass the executionContent into your JavaScript function as a parameter.
Yes I did, Still Im Facing this error.
In your code snippet there is a . after the ;. Your function will need to look like this:
function functionName(executionContext) { var formContext = executionContext.getFormContext(); }
Sorry for Confusion, I just used .here to end the paragraph, not in actual code.
Hi,
If you have passed the execution context then it should not throw this error message (it could be something else though). Try refreshing the cache or try in InPrivate/Incognito mode and see if it helps.
If it still doesn't help, share some more details about the field, event you have registered and a full screenshot if possible.
Hope this helps.
Im using folllowing code
***.******.FormOnload = function (executionContext) { var formContext = executionContext.getFormContext();
}
Did you retry "Publish All Customizations" ?
Was there ever a solution found for this?
I am receiving the same error.
Would you be able to post your code?
I was able to get it working by following this:
https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/executioncontext/getFormContext
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.
Congratulations to a top community star!
In our never-ending quest to help the Dynamics 365 Community members get answers faster …
Welcome to the next edition of the Community Platform Update. This is a status …
Stay up to date on forum activity by subscribing.