locked
Case Form - Stack overflow at line: 0 from the contact lookup RRS feed

  • Question

  • Hi,

     

    I am facing a problem with MS CRM 4.0. In "Case" form, I have a lookup for contact and in the OnChange event, I have some javascript code. When the lookup is clicked in IE v6.0, the error "Stack overflow at line: 0" message appears in a messagebox and clicking on Ok, the lookup autoresolves to the selected customer.

     

    Even when I remove all the code within the OnChange Event and have only an alert message, the error appears. The error is not appearing only when the event is disabled. In the case form all other lookups are working fine. I tried changing the browser settings security to low. No luck!

     

     Thanks in advance

     

    Tuesday, August 5, 2008 8:47 AM

Answers

  • The problem has been solved.

     

    Solution:

    Removed the onchange event at the attribute level and attached the event to the attribute in the Page onload event.

     

    sample:

     

    var myfunc = function()
    {
    alert("myfunc");
    }
    crmForm.all.myfield.attachEvent("onchange", myfunc);

     


     

     

    Monday, August 18, 2008 6:13 AM

All replies

  • Enable debugging and see where it breaks in visual studio.

     

     

    Tuesday, August 5, 2008 9:11 AM
  • The case entity is working fine in my development server and the training server. I get this issue only in the UAT server.

    Tuesday, August 5, 2008 9:56 AM
  • Still, open the ie from your machine ,after enabling debugging, navigate to the UAT server case form , in ie --> view --> script debugger --> open --> refresh the page and see where it breaks.

     

    to enable debugging in ie goto tools --> internet options --> advanced tab --> uncheck disable script debugging (internet explorer) --> reopen ie.

     

     

     

     

    Tuesday, August 5, 2008 10:04 AM
  • When I try debugging the case form, I find the execution to break in _forms/formsscript.js.aspx(in the system file).

     

    I have given the code below that I got it from the script debugger and I have highlighted the code in yellow where the execution breaks.

     

    var control = crmForm.all.customerid;
    if (control != null)
    {
     var newcustomeridonchange0;
     if (typeof(control.onchange) == 'function')
     {
      var oldcustomeridonchange0 = control.onchange;
      newcustomeridonchange0 = function() { oldcustomeridonchange0(); customerid_onchange();};
     }
     else
     {
      newcustomeridonchange0 = customerid_onchange;
     }
     control.onchangeHandler = newcustomeridonchange0;
     control.onchange = function(){if (typeof(event.CustomHandler) === 'function'){event.CustomHandler();}else{ newcustomeridonchange0();};}
    }

     

    Thanks in Advance,

    Geetha

    Tuesday, August 5, 2008 11:57 AM
  • it seems problem in javascript

     

    I suggest if you disable onchange event and then check.

     

    For More see MS CRM Support section

     

    http://support.microsoft.com/ph/12976

     

    Regards,
    Imran

    http://www.crmxperts.com


     

     

    Wednesday, August 6, 2008 12:41 PM
    Moderator
  • when I disable the onchange event, the error is not coming. only when I enable the event, the error arises. I do have multiple lookups in the same case form, but I don't face any problem with them.

    Wednesday, August 6, 2008 2:31 PM
  • If you remove that lookup and run application, restart IIS and then add again lookup.

     

    still error??

     

    For More see MS CRM Support section

     

    http://support.microsoft.com/ph/12976

     

    Regards,
    Imran

    http://www.crmxperts.com


     

     

    Thursday, August 7, 2008 5:38 AM
    Moderator
  • The lookup's requirement level is system required and hence am not able to remove it from the form.

     

    Thanks,

    Geetha

     

    Thursday, August 7, 2008 9:44 AM
  • In the debugger alert the CustomHandler e.g. alert( event.CustomHandler );

    This will display the function content and tell you more about why the stack overflow is happening.

     

    anyway, in order to remove a required field from the form you first need to change the attribute require level , save your changes and then remove it from the form.

     

    Cheers,

    Adi

     

    Friday, August 8, 2008 9:05 AM
  • The problem has been solved.

     

    Solution:

    Removed the onchange event at the attribute level and attached the event to the attribute in the Page onload event.

     

    sample:

     

    var myfunc = function()
    {
    alert("myfunc");
    }
    crmForm.all.myfield.attachEvent("onchange", myfunc);

     


     

     

    Monday, August 18, 2008 6:13 AM
  • Hi Geetha,

    Thanks for your solution, this resolved my issue.

    Can you please provide me the reason why this is happening like this. (because this problem is getting for me for some records not for all the records.)

    Thanks and Regards,


    prasanth : MS CRM Developer.
    Wednesday, December 14, 2011 11:31 AM
  • Thanks GeethaC,

    I was facing the same issue and your resolution helped me out.

    Thanks a lot for sharing your experience.

    Kind Regards

    Jaber


    Kind Regards Jaber

    Wednesday, June 27, 2012 12:58 AM