Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

TypeError: Object doesn't support property or method on OnChange Event

(0) ShareShare
ReportReport
Posted on by 450

Hi all,

I have very interesting puzzling issue in our  environment.

I have  Javascript file sc1.js with the same namespace say namespace1 and I have 1 forms namely form1

On form1  we use sc1.js

In the sc1.js there is a function called method1 which is being called on OnChange of a field. 

When I debug I can see that the 'method1' is there on the form load but but once the field is changed the function disappears and we get the following error.

TypeError: Object doesn't support property or method 'method1'

at eval code (eval code:1:1)
at RunHandlerInternal (dynamics16-dev1/.../ClientApiWrapper.aspx)
at RunHandlers (dynamics16-dev1/.../ClientApiWrapper.aspx)
at ExecuteHandler (dynamics16-dev1/.../ClientApiWrapper.aspx)
at Mscrm.TurboForm.Control.CustomScriptsManager.prototype.$C7_1 (dynamics16-dev1/.../JsProvider.ashx;ids=1223231347-405283869:8908:17)
at Mscrm.TurboForm.Control.CustomScriptsManager.prototype.executeHandler (dynamics16-dev1/.../JsProvider.ashx;ids=1223231347-405283869:8854:13)
at Mscrm.TurboForm.Control.CustomScriptsManager.prototype.executeHandlerByDescriptor (dynamics16-dev1/.../JsProvider.ashx;ids=1223231347-405283869:8885:13)
at Anonymous function (dynamics16-dev1/.../JsProvider.ashx;ids=1223231347-405283869:8893:13)
at Anonymous function (dynamics16-dev1/.../global.ashx)
at Mscrm.TurboForm.Control.Data.DataAttributeBase.prototype.fireOnChange (dynamics16-dev1/.../JsProvider.ashx;ids=1223231347-405283869:16728:13)

Not sure exactly whats happening and why the function is not being fired onChange? Please let me know if you need any more information.

I logged in as System Admin and my environment is CRM 2016 SP1.

Thank you in advance for your help.

Regards,

Dan.

*This post is locked for comments

  • Suggested answer
    Kishor Kumar Profile Picture
    Kishor Kumar 3,702 on at
    RE: TypeError: Object doesn't support property or method on OnChange Event

    Check the event Viewer

    www.howtogeek.com/.../lesson3

  • Suggested answer
    indlad Profile Picture
    indlad 450 on at
    RE: TypeError: Object doesn't support property or method on OnChange Event

    Hello all,

               Found the issue. When I set the option "Use legacy form rendering" to Yes.The script worked fine. The issue with using XRMServiceToolkit. We have to change it to WebAPI I believe. This might be helpful to others.

    Regards,

    Daniel.

  • indlad Profile Picture
    indlad 450 on at
    RE: TypeError: Object doesn't support property or method on OnChange Event

    I configured to fire an Event on OnChange of a Checkbox field.

    Update:  have another JavaScript file with the Same Namspace and when I set the debugger I see that other JavaScript file with the same Namespace is being loaded with 'Unknown..Code(8) and I see that all the javascript code from that file. but on the form or on the attribute , this file is not included. Any idea?

    Dan.

  • Suggested answer
    RE: TypeError: Object doesn't support property or method on OnChange Event

    Are you changing forms onload or onchange?

  • indlad Profile Picture
    indlad 450 on at
    RE: TypeError: Object doesn't support property or method on OnChange Event

    H Sachith,   Thank you. yes I am calling as namespace1.method1.

    Interested in

    ?ver=-653655226:158:1

    ?ver=-653655226:117:1

    ?ver=-653655226:80:1

    ?bundle=FormControlBundle&ids=1223231347-405283869:8908:17

    ?bundle=FormControlBundle&ids=1223231347-405283869:8854:13

    ?bundle=FormControlBundle&ids=1223231347-405283869:8885:13

    ?bundle=FormControlBundle&ids=1223231347-405283869:8893:13

    ?ver=-653655226:21020:138652

    ?bundle=FormControlBundle&ids=1223231347-405283869:16728:13

    these parameters.

    When I deployed the new form with some changes  as a Solution, this started to happen.

    Not sure if there is any version difference with the JS file and the Form.

  • indlad Profile Picture
    indlad 450 on at
    RE: TypeError: Object doesn't support property or method on OnChange Event

    I logged on as System Admin.

  • Suggested answer
    SCV Profile Picture
    SCV 1,004 on at
    RE: TypeError: Object doesn't support property or method on OnChange Event

    Hi Dan,

    Have you set the function name as namespace1.method1 in the onChange event property on the form?

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,076 on at
    RE: TypeError: Object doesn't support property or method on OnChange Event

    Hi,

    Please refer the thread below.

    community.dynamics.com/.../205628

  • EmployeeOcta Profile Picture
    EmployeeOcta 2 on at
    RE: TypeError: Object doesn't support property or method on OnChange Event

    Check out with below url, may be it will help you.

    community.dynamics.com/turbo-forms-get-your-javascript-ready-for-crm2015-update-1

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans