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)

Script Error

(0) ShareShare
ReportReport
Posted on by

Hello,

I'm having some trouble with CRM Dynamics 365. When oppening an opportunitty (creating a new one, or accessing an existing opportunity), I'm allways receiving the following message:

"Script Error
One of the scripts for this record has caused an error. For more details, download the log file.
TypeError: Cannot read property 'opportunity' of undefined at eval (eval at RunHandlerInternal (stratioautomotive.crm4.dynamics.com/.../ClientApiWrapper.aspx), <anonymous>:1:9)"

The only plugin I've incorporated in my CRM is adx for deploying partner portals.

Any thoughts on how can I solve this script error?


The log Files presents the following information:

TypeError: Cannot read property 'opportunity' of undefined
at eval (eval at RunHandlerInternal (stratioautomotive.crm4.dynamics.com/.../ClientApiWrapper.aspx), <anonymous>:1:9)
at RunHandlerInternal (stratioautomotive.crm4.dynamics.com/.../ClientApiWrapper.aspx)
at RunHandlers (stratioautomotive.crm4.dynamics.com/.../ClientApiWrapper.aspx)
at OnScriptTagLoaded (stratioautomotive.crm4.dynamics.com/.../ClientApiWrapper.aspx)
at stratioautomotive.crm4.dynamics.com/.../ClientApiWrapper.aspx


Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    Hi Diogo,

    This error is very specific to Client side not server so plugin will not be factor here.

    Please check by going to form editor if there are any scripts attached to the form?

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at
  • Community Member Profile Picture
    on at

    Thanks for the answer Rawish.

    I've created the solution for the entity "opportunity" with all the forms attached.

    After exporting, I've search in the xml for the reference "ClientApiWrapper.aspx" and found no reference...

  • Community Member Profile Picture
    on at

    This is what i get when watching the loading log.

    8130.Capturar.PNG

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    Hi Diogo,

    You have to look for something like below in form xmls :

    In my example it was “form_onload” but in your case its “opportunity” which is attached to internalhandler.

    Also please take a solution backup.

    <!–<InternalHandlers>

                       <Handler functionName=”Mscrm.ContactMainSystemLibraryWebResource.Opportunity” libraryName=”Contact_main_system_library.js” handlerUniqueId=”4ea24ebd-795d-434e-af94-6812c3867b54″ enabled=”true” />

                     </InternalHandlers> –>

  • Community Member Profile Picture
    on at

    I'm not shure what i'm looking for, but with the information i found these part of the code multiple times.

    How can i solve this??

    <event name="onload" application="true" active="true">
    <InternalHandlers>
    <Handler functionName="Mscrm.Form_onload" libraryName="Opportunity_main_system_library.js" handlerUniqueId="228e5887-18c6-4d90-8d6e-bae09af2d977" enabled="true">
    <dependencies>
    <dependency id="estimatedvalue" />
    <dependency id="isrevenuesystemcalculated" />
    </dependencies>
    </Handler>
    </InternalHandlers>
    </event>


  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    Yes - these will be there multiple times.

    you have to look for the one where opportunity function is being called as mentioned in your error.

    so mainlibrary."Opportunity" look for this in the internal handler tags & just comment out that internal handlers and import back the solution.

  • Community Member Profile Picture
    on at

    in all of them, the library is beeing called "Opportunity_main_system_library.js"

    But i've found something that doesn't appear quite right to me:

    <clientresources>
                    <internalresources>
                      <clientincludes>
                        <internaljscriptfile src="/_static/sfa/sfautil.js" />
                        <internaljscriptfile src="/_static/sfa/opps/opps.js" />
                        <internaljscriptfile src="/_static/sfa/quotes/qoi_script.js" />
                        <internaljscriptfile src="$webresource:Opportunity_main_system_library.js" />
                      </clientincludes>


  • Community Member Profile Picture
    on at

    Ok, back to the basics.

    Just Tryed with IE and Edge Browser... The problem seems to only appear in Chrome....

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