Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Refrerence error: some function is not defined at eval.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

i am getting error while saving the data in dyanmic crm on form save. i have created "UpdateRecordOnasave" method in the js file. Below the errror which is disaplying

ReferenceError: UpdateRecordOnasave is not defined
    at eval (eval at RunHandlerInternal (arunjatin.crm8.dynamics.com/.../ClientApiWrapper.aspx), <anonymous>:1:1)
    at RunHandlerInternal (arunjatin.crm8.dynamics.com/.../ClientApiWrapper.aspx)
    at RunHandlers (arunjatin.crm8.dynamics.com/.../ClientApiWrapper.aspx)
    at ExecuteHandler (arunjatin.crm8.dynamics.com/.../ClientApiWrapper.aspx)
    at Mscrm.TurboForm.Control.CustomScriptsManager.$C3_1 (arunjatin.crm8.dynamics.com/.../JsProvider.ashx;ids=1223231347-405283869:8907:91)
    at Mscrm.TurboForm.Control.CustomScriptsManager.executeHandler (arunjatin.crm8.dynamics.com/.../JsProvider.ashx;ids=1223231347-405283869:8853:18)
    at Mscrm.TurboForm.Control.CustomScriptsManager.executeHandlerByDescriptor (arunjatin.crm8.dynamics.com/.../JsProvider.ashx;ids=1223231347-405283869:8884:18)
    at arunjatin.crm8.dynamics.com/.../JsProvider.ashx;ids=1223231347-405283869:8892:19
    at arunjatin.crm8.dynamics.com/.../global.ashx
    at Mscrm.TurboForm.Control.Data.DataEntity.$D4_1 (arunjatin.crm8.dynamics.com/.../JsProvider.ashx;ids=1223231347-405283869:17706:13)

Please suggest me to solve this.

*This post is locked for comments

  • Suggested answer
    Fabricio Profile Picture
    Fabricio 35 on at
    RE: Refrerence error: some function is not defined at eval.

    I checked the quotation marks as one of the users above suggested, and that worked for me!

  • Suggested answer
    Fabricio Profile Picture
    Fabricio 35 on at
    RE: Refrerence error: some function is not defined at eval.

    This worked for me!

  • SudhirPr Profile Picture
    SudhirPr 45 on at
    RE: Refrerence error: some function is not defined at eval.

    Was someone able to reach a logical resolution to this thread / original question ? I tried all the methods suggested in the thread, but keep encountering it. Any other thoughts ?

  • Suggested answer
    DebbieInTx Profile Picture
    DebbieInTx 17 on at
    RE: Refrerence error: some function is not defined at eval.

    Syntax errors seem to be the most common cause of this problem, but my code was clean and the "not defined at eval" error was sporadic; sometimes my scripts would load with no problems, sometimes one would get the error. I finally realized that I had added an assignment which referenced a function in another script to the global scope of the problematic script ... having temporarily forgotten that form "libraries" (scripts) are loaded asynchronously, so sometimes the referenced script loaded first and sometimes it didn't.

    Hope this helps someone in a similar predicament.

  • Suggested answer
    Muhammad Ainuddin Profile Picture
    Muhammad Ainuddin 104 on at
    RE: Refrerence error: some function is not defined at eval.

    Hi, try validate your javascript. Might have sintax error. You can validate it using this website. www.piliapp.com/javascript-validator

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Refrerence error: some function is not defined at eval.

    Hi

    I had the same problem. My error was also that a function was not defined.

    Solution: Make sure the function name on the form trigger is the same within your script 

    Hope it helps.

    BR Rob

  • Roxana Profile Picture
    Roxana 689 on at
    RE: Refrerence error: some function is not defined at eval.

    Hi, 

    Take out or delete the comments.

    I have no errors after deleting comments.

    Regards.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Refrerence error: some function is not defined at eval.

    John,

    Can you share the screen shot of the form properties where you specify the OnSave handler function?

    Are you getting this error while loading the form, or are you getting this error while saving?

    Thanks,

    Charmis

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Refrerence error: some function is not defined at eval.

    Please check for Double Quotes in your Script. Generally, when someone copies the code from browser and paste it, the double quotes will be different. If that is the case with you, this check will solve the problem.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Refrerence error: some function is not defined at eval.

    Hi P NOUSHAD have you solved the error or still you are facing the same. In my case i have added jquery, Json file in form load.

    If you have already added that then can you please share your js file so that we can look into that and give you proper solution.

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans