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 :
Customer Service forum

Cannot read property 'getFormContext' of undefined

(0) ShareShare
ReportReport
Posted on by 249

Facing error "TypeError: Cannot read property 'getFormContext' of undefined" after updating JavaScript files to new  

var formContext = executionContext.getFormContext();.

 

Categories:
I have the same question (0)
  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi raki,

    You need to make sure that you pass the executionContent into your JavaScript function as a parameter.

  • raki Profile Picture
    249 on at

    Yes I did, Still Im Facing this error.

  • Suggested answer
    Adrian Begovich Profile Picture
    1,027 Moderator on at

    Hi raki,

    In your code snippet there is a . after the ;. Your function will need to look like this:

    function functionName(executionContext) {
        var formContext = executionContext.getFormContext(); 
    }
  • raki Profile Picture
    249 on at

    Sorry for Confusion, I just used .here to end the paragraph, not in actual code.

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    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.

  • raki Profile Picture
    249 on at

    1234.Capture.PNG

    Im using folllowing code

    ***.******.FormOnload = function (executionContext) {
    var formContext = executionContext.getFormContext();

    }

  • Srujan K Profile Picture
    317 on at

    Did you retry "Publish All Customizations" ?

  • Community Member Profile Picture
    on at

    Was there ever a solution found for this?

    I am receiving the same error.

  • T.I.A Profile Picture
    1,760 on at

    Would you be able to post your code?

  • Community Member Profile Picture
    on at

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans