Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

error in opportunity form (description on body)

Posted on by Microsoft Employee

Hello,

This still referes to CRM Dynamics 4.0.

I added a custom attribute to the form (Money field) and then removed it from the form, deleted the atribute and now I'm getting a javascript error stating:

"The value of the property 'isrevenuesystemcalculated_onchange' is null or undefined, not a Function object"

I've been working and developing for CRM 4 for 7+ years and never came across this.

anyone knows what this might be? (I checked the onchange event for that field and its turned off)

Any help appreciated.

Thanks

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: error in opportunity form (description on body)

    Sorry for insisting, but still looking for someone out there that might have a clue to this issue.

    Thanks in advance.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: error in opportunity form (description on body)

    I tested it now and the code doesn't even reach the "OnLoad" event of the form (the one we can handle through customizations.

    I put an alert at the very top and it didn't fire.

    Plus, if I use Developer Tools, FormScript.js file doesn't even get loaded. Doesn't show up on the debugger.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: error in opportunity form (description on body)

    @Ravi

    Yes, I'm aware of that. It's this part but it's exactly the same as on the environment that is working.

    <events>
                                  <event name="onchange" application="true" active="true">
                                    <script><![CDATA[
    													crmForm.all.estimatedvalue.Disabled = crmForm.all.isrevenuesystemcalculated.DataValue;
    												]]></script>
                                    <dependencies>
                                      <dependency id="estimatedvalue" />
                                    </dependencies>
                                  </event>
                                </events>
                                <control id="isrevenuesystemcalculated" classid="{67FAC785-CD58-4f9f-ABB3-4B7DDC6ED5ED}" datafieldname="isrevenuesystemcalculated" disabled="false" />


  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: error in opportunity form (description on body)

    This is what's happening and the textbox should be disabled (sorry , it's in Portuguese) because System calculated is selected.

    This is the cal that's being made and is causing the error:

    http://crmiis/EsriPortugal/_forms/FormScript.js.aspx?etc=3&FormType=main&FormName=crmForm

    I do have some scripts on the form load but they were there before the error started to happen.

    3632.img1.png3632.img1.pngimg0.png

    The stack is:

    Conteúdo do Relatório de Erros do Microsoft Dynamics CRM
    
    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
    	<Message>Syntax error</Message>
    	<Line>524</Line>
    	<URL>/EsriPortugal&#47;_forms&#47;FormScript.js.aspx&#63;etc&#61;3&#38;FormType&#61;main&#38;FormName&#61;crmForm</URL>
    	<PageURL>/EsriPortugal&#47;sfa&#47;opps&#47;edit.aspx&#63;id&#61;&#123;30E1ADCC-0BE0-E711-814A-00155DC80D07&#125;</PageURL>
    	<Function></Function>
    	<CallStack>
    	</CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
    	<BrowserUserAgent>Mozilla&#47;4.0 &#40;compatible&#59; MSIE 7.0&#59; Windows NT 10.0&#59; WOW64&#59; Trident&#47;7.0&#59; .NET4.0C&#59; .NET4.0E&#59; .NET CLR 2.0.50727&#59; .NET CLR 3.0.30729&#59; .NET CLR 3.5.30729&#41;</BrowserUserAgent>
    	<BrowserLanguage>en-US</BrowserLanguage>
    	<SystemLanguage>pt-PT</SystemLanguage>
    	<UserLanguage>pt-PT</UserLanguage>
    	<ScreenResolution>1600x900</ScreenResolution>
    	<ClientName>Web</ClientName>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>2070</OrgLanguage>
        <OrgCulture>2070</OrgCulture>
        <UserLanguage>2070</UserLanguage>
        <UserCulture>2070</UserCulture>
        <OrgID>&#123;44456501-D865-4F17-AE4E-3AC8818C1089&#125;</OrgID>
        <UserID>&#123;7AD05B81-901D-E011-B124-00155DC85A01&#125;</UserID>
        <CRMVersion>4.0.7333.3414</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>
    
    <CrmScriptErrorReport>
      <ReportVersion>1.0</ReportVersion>
      <ScriptErrorDetails>
    	<Message>The value of the property &#39;isrevenuesystemcalculated_onchange&#39; is null or undefined, not a Function object</Message>
    	<Line>266</Line>
    	<URL>/EsriPortugal&#47;sfa&#47;opps&#47;edit.aspx&#63;id&#61;&#123;30E1ADCC-0BE0-E711-814A-00155DC80D07&#125;</URL>
    	<PageURL>/EsriPortugal&#47;sfa&#47;opps&#47;edit.aspx&#63;id&#61;&#123;30E1ADCC-0BE0-E711-814A-00155DC80D07&#125;&#35;</PageURL>
    	<Function></Function>
    	<CallStack>
    	</CallStack>
      </ScriptErrorDetails>
      <ClientInformation>
    	<BrowserUserAgent>Mozilla&#47;4.0 &#40;compatible&#59; MSIE 7.0&#59; Windows NT 10.0&#59; WOW64&#59; Trident&#47;7.0&#59; .NET4.0C&#59; .NET4.0E&#59; .NET CLR 2.0.50727&#59; .NET CLR 3.0.30729&#59; .NET CLR 3.5.30729&#41;</BrowserUserAgent>
    	<BrowserLanguage>en-US</BrowserLanguage>
    	<SystemLanguage>pt-PT</SystemLanguage>
    	<UserLanguage>pt-PT</UserLanguage>
    	<ScreenResolution>1600x900</ScreenResolution>
    	<ClientName>Web</ClientName>
      </ClientInformation>
      <ServerInformation>
        <OrgLanguage>2070</OrgLanguage>
        <OrgCulture>2070</OrgCulture>
        <UserLanguage>2070</UserLanguage>
        <UserCulture>2070</UserCulture>
        <OrgID>&#123;44456501-D865-4F17-AE4E-3AC8818C1089&#125;</OrgID>
        <UserID>&#123;7AD05B81-901D-E011-B124-00155DC85A01&#125;</UserID>
        <CRMVersion>4.0.7333.3414</CRMVersion>
      </ServerInformation>
    </CrmScriptErrorReport>
    
    


  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: error in opportunity form (description on body)

    Hi Ricardo,

    Thoguh I do not have access to 4.0 but believes this method is an internal CRM method which is still being used in the new version D365.

    Here is the customization for opportunity form from D365 [8.2]

    -----------

    <event name="onchange" attribute="isrevenuesystemcalculated" application="true" active="true">

                     <InternalHandlers>

                       <Handler functionName="Mscrm.isrevenuesystemcalculated_onchange" libraryName="Opportunity_main_system_library.js" handlerUniqueId="3b6c5880-6469-48bc-9642-f5350374785b" enabled="true">

                         <dependencies>

                           <dependency id="estimatedvalue" />

                           <dependency id="totalamount" />

                         </dependencies>

                       </Handler>

                     </InternalHandlers>

                   </event>

    -------------------

    If you have any other CRM 4 organization where this is working fine then you can compare the customization and figure out what has changed. This may give you some idea how to go about it.

    Hope this helps.

  • tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: error in opportunity form (description on body)

    Is this the only error that you are getting in JavaScript? Have you checked the whole JavaScript console for any other errors? For me it looks like the problem is elsewhere - you have some exception in this FormScript.aspx which causes break of parsing the JS (as you probably know, in case of uncaught exception processing of the file will stop, but the other files will still be processed). So there is some error (syntax error whatever) and you don't have this function available in the context. Are any custom scripts loaded on this form or is this error happening before anything custom loads? Maybe you can provide a stacktrace for this exception, probably it would not be meaningful but maybe it will point us to the right direction

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: error in opportunity form (description on body)

    Anyone have any further ideas?

    Or something I can provide that would help?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: error in opportunity form (description on body)

    Nah, doesn't work either...

    I don't even know how this is possible with adding and removing a Money field....

  • tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: error in opportunity form (description on body)

    This may be a really dummy solution, but maybe worth a try - just create this function for this form (I mean: function isrevenuesystemcalculated_onchange). I understand that this is not a proper fix, but rather a technical workaround, but I guess you've found some hidden bug in CRM 4.0 and it will never ever be fixed as it is no longer supported...

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: error in opportunity form (description on body)

    apparently that window.onload is correct. What isn't is the FormScript.aspx which should load this but for some reason isn't :W

    window.attachEvent("onload", crmFormOnLoadHandler);
    
    function crmFormOnLoadHandler()
    {
    var control = crmForm.all.pricelevelid;
    if (control != null)
    {
    	var newpricelevelidsetadditionalparams0;
    	if (typeof(control.setadditionalparams) == 'function')
    	{
    		var oldpricelevelidsetadditionalparams0;
    		if (typeof(control.setadditionalparamsHandler) === 'function')
    		{
    			oldpricelevelidsetadditionalparams0 = control.setadditionalparamsHandler;
    		}
    		else
    		{
    			oldpricelevelidsetadditionalparams0 = control.setadditionalparams;
    		}
    		newpricelevelidsetadditionalparams0 = function() { oldpricelevelidsetadditionalparams0(); pricelevelid_setadditionalparams();};
    	}
    	else
    	{
    		newpricelevelidsetadditionalparams0 = pricelevelid_setadditionalparams;
    	}
    
    	control.setadditionalparamsHandler = newpricelevelidsetadditionalparams0;
    	control.setadditionalparams = function(){if (typeof(event.CustomHandler) === 'function'){event.CustomHandler();}else{ newpricelevelidsetadditionalparams0();};}
    }
    
    var control = crmForm.all.isrevenuesystemcalculated;
    if (control != null)
    {
    	var newisrevenuesystemcalculatedonchange0;
    	if (typeof(control.onchange) == 'function')
    	{
    		var oldisrevenuesystemcalculatedonchange0;
    		if (typeof(control.onchangeHandler) === 'function')
    		{
    			oldisrevenuesystemcalculatedonchange0 = control.onchangeHandler;
    		}
    		else
    		{
    			oldisrevenuesystemcalculatedonchange0 = control.onchange;
    		}
    		newisrevenuesystemcalculatedonchange0 = function() { oldisrevenuesystemcalculatedonchange0(); isrevenuesystemcalculated_onchange();};
    	}
    	else
    	{
    		newisrevenuesystemcalculatedonchange0 = isrevenuesystemcalculated_onchange;
    	}
    
    	control.onchangeHandler = newisrevenuesystemcalculatedonchange0;
    	control.onchange = function(){if (typeof(event.CustomHandler) === 'function'){event.CustomHandler();}else{ newisrevenuesystemcalculatedonchange0();};}
    }
    crmForm_window_onload0();
    }
    
    function displayError(controlName, eventName, errorDescription)
    {
    	alert("Ocorreu um erro com o evento personalizado deste campo.\n\nCampo\x3a" + controlName + "\n\nEvento\x3a" + eventName + "\n\nErro\x3a" + errorDescription);
    }
    
    function crmForm_window_onload0()
    {
    
    if (event.returnValue != false)
    {
    try
    {
    if(crmForm.FormType == 1)    
     {    
     if (crmForm.all.esri_parceiroid.DataValue != null)     
        {        
                   crmForm.all.esri_parceiroid.DataValue = null;    
         }   
      }
    
    InitialiseForm();
    }
    catch(e)
    {
    	displayError("window", "onload", e.description);
    }
    }
    }
    
    function pricelevelid_setadditionalparams()
    {
    
    try
    {
    
    																	var oLookup = event.srcElement;
    																	AddTransactionCurrencyParam(oLookup);
    																	
    }
    catch(e)
    {
    	displayError("pricelevelid", "setadditionalparams", e.description);
    }
    }
    
    function isrevenuesystemcalculated_onchange()
    {
    
    try
    {
    
    													crmForm.all.estimatedvalue.Disabled = crmForm.all.isrevenuesystemcalculated.DataValue;
    												
    }
    catch(e)
    {
    	displayError("isrevenuesystemcalculated", "onchange", e.description);
    }
    }
    
    


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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans