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 :
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

I have the same question (0)
  • EmployeeOcta Profile Picture
    6 on at

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

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

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi,

    Please refer the thread below.

    community.dynamics.com/.../205628

  • Suggested answer
    SCV Profile Picture
    1,004 on at

    Hi Dan,

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

  • indlad Profile Picture
    450 on at

    I logged on as System Admin.

  • indlad Profile Picture
    450 on at

    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.

  • Suggested answer
    Community Member Profile Picture
    on at

    Are you changing forms onload or onchange?

  • indlad Profile Picture
    450 on at

    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
    indlad Profile Picture
    450 on at

    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.

  • Suggested answer
    Kishor Kumar Profile Picture
    3,710 on at

    Check the event Viewer

    www.howtogeek.com/.../lesson3

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans