Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Js Error. TypeError: Cannot set property 'eventManager' of null

Posted on by Microsoft Employee

I have js error "TypeError: Cannot set property 'eventManager' of null ..." on opening record in CRM online. It was working 1-2 weeks ago and I didn't change anything. It seems that last CRM system update contains some changes regarding js. I have figured out that I have this error only if I am trying to add onload event to the subgrid(https://msdn.microsoft.com/en-us/library/dn932126.aspx#BKMK_subgridAddOnLoad).  Error popup is shown only sometimes. But even if it not shown then Add button (+) and other is missing in that subgrid. If I disable function where I add onload event to the subgrid everything works fine.

Does anybody have this problem during last 1-2 weeks? 

I have CRM version 8.2.1.207. Here more detail error:

TypeError: Cannot set property 'eventManager' of null
at Mscrm.TurboForm.Control.ViewModel.SubGridViewModel.initializeTurboGridControl ([myCrmUrl]_static/form/formcontrols.js?ver=1076596692:17743:27)
at Mscrm.TurboForm.Control.ViewModel.SubGridViewModel.get_turboGridControl ([myCrmUrl]_static/form/formcontrols.js?ver=1076596692:17662:18)
at Mscrm.FormControls.ClientApi.XrmTurboFormControlSubGrid.addOnLoad ([myCrmUrl]_static/form/formcontrols.js?ver=1076596692:10879:19)
at addParticipantGridEvents ([myCrmUrl]%7B636321977380000207%7D/WebResources/dyna_Course_JScript?ver=1076596692:229:25)
at eval (eval at RunHandlerInternal ([myCrmUrl]form/ClientApiWrapper.aspx?ver=1076596692:153:1), <anonymous>:1:1)
at RunHandlerInternal ([myCrmUrl]form/ClientApiWrapper.aspx?ver=1076596692:158:1)
at RunHandlers ([myCrmUrl]form/ClientApiWrapper.aspx?ver=1076596692:117:1)
at OnScriptTagLoaded ([myCrmUrl]form/ClientApiWrapper.aspx?ver=1076596692:232:1)
at [myCrmUrl]form/ClientApiWrapper.aspx?ver=1076596692:201:1

*This post is locked for comments

  • Suggested answer
    RE: Js Error. TypeError: Cannot set property 'eventManager' of null

    We had the same problem. The latest service update 9 (Version 8.2.1.411, October 2017) finally fixed it. 

  • Shaik Profile Picture
    Shaik on at
    RE: Js Error. TypeError: Cannot set property 'eventManager' of null

    Hi,

    We are also facing same issue. Following Scotts suggestion if I delay attaching subgrid by 1 sec, I don't see the JScript issue, but + button is not visible for first time and when we refresh again + button is visible. Any clues ? until we update to next version 8.2.1.271

    window.setTimeout(WrapSubGridOnLoad, 1000);


    function WrapSubGridOnLoad()
    {
    Xrm.Page.getControl("Countries").addOnLoad(OnCountryAssociate);
    Xrm.Page.getControl("Sectors").addOnLoad(OnSectorsAssociate);
    }

    Thanks,

    Shaik

  • Dhasara Devi G N Profile Picture
    Dhasara Devi G N 354 on at
    RE: Js Error. TypeError: Cannot set property 'eventManager' of null

    Hi,

    Is the below error related to the same issue? If yes, do we know the fix date? thank you...

    TypeError: Unable to set property 'eventManager' of undefined or null reference
       at Mscrm.TurboForm.Control.ViewModel.SubGridViewModel.prototype.initializeTurboGridControl ([CRMURL]/_static/form/formcontrols.js?ver=1027009357:17743:9)
       at Mscrm.TurboForm.Control.ViewModel.SubGridViewModel.prototype.get_turboGridControl ([CRMURL]/_static/form/formcontrols.js?ver=1027009357:17662:13)
       at Mscrm.FormControls.ClientApi.XrmTurboFormControlSubGrid.prototype.getGrid ([CRMURL]/_static/form/formcontrols.js?ver=1027009357:10863:9)
       at initializeQuoteNavigation ([CRMURL]/%7B636325541920000207%7D/WebResources/msdyn_/Project/Scripts/ProjectInitialization.js?ver=1027009357:231:9)
       at eval code (eval code:1:1)
       at RunHandlerInternal ([CRMURL]/form/ClientApiWrapper.aspx?ver=1027009357:158:1)
       at RunHandlers ([CRMURL]/form/ClientApiWrapper.aspx?ver=1027009357:117:1)
       at OnScriptTagLoaded ([CRMURL]/form/ClientApiWrapper.aspx?ver=1027009357:232:1)
       at Anonymous function ([CRMURL]/form/ClientApiWrapper.aspx?ver=1027009357:201:1)

  • Diana.P33 Profile Picture
    Diana.P33 on at
    RE: Js Error. TypeError: Cannot set property 'eventManager' of null

    The hotfix release has been delayed...see CR105384. I don't think Microsoft has this resolved yet...we're still experiencing this problem. 

    Title: SubGrid functionality degradation

    User Impact: Users are unable to load SubGrids

    Current Status: Microsoft engineers have developed a code fix for this issue and deployment of the fix is in progress worldwide. An update will be provided once the deployment is completed. Thank you for your patience while we work toward a resolution.

    User Experience: Affected users are unable to view SubGrids.

    Customer Impact: A subset of customers worldwide

    Incident Start Time: Wednesday, June 7, 2017, 11:47 AM UTC

  • PZ123 Profile Picture
    PZ123 on at
    RE: Js Error. TypeError: Cannot set property 'eventManager' of null

    Awesome! Do you know when this was fixed? I was getting the error about an hour or so ago.

  • ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Js Error. TypeError: Cannot set property 'eventManager' of null

    This issue has now been fixed in version 8.2.1.271

  • PZ123 Profile Picture
    PZ123 on at
    RE: Js Error. TypeError: Cannot set property 'eventManager' of null

    Hello, I am having the exact same issue. Can you please share the code you used to fix the issue? Thanks. 

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Js Error. TypeError: Cannot set property 'eventManager' of null

    Is it possible for me to follow this ticket?

  • AtulSharma Profile Picture
    AtulSharma 130 on at
    RE: Js Error. TypeError: Cannot set property 'eventManager' of null

    Hi Scott,

    I am getting the same error message, if I use this 

    Xrm.Page.getControl("Contacts").getGrid().getTotalRecordCount();

    it is because of the same reason or something else?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Js Error. TypeError: Cannot set property 'eventManager' of null

    Hi Scott. Thank you for information. Wrapping the addOnLoad in setTimeout helped me.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans