MS CRM 4.0 – Error message "Stack overflow at line: " is displayed when OnChange event is fired on lookup fields in Incident Entity.

31 במאי 2011

אין תגובות

When "OnChange" event is defined in customization level on lookup field in Incident Entity


and user choose some value in lookup window, error message "Stack overflow at line: " is


displayed. If you disable "OnChange" event on lookup field this error message doesn't appeared.


For solving this problem you need disable "OnChange" event in customization level


and attach this event to field inside javascript code, for example:


 crmForm.all.subjectid.attachEvent("onchange", Subjectid_Onchange);


Where Subjectid_Onchange is javascript function, that provide needed functionality.


This solution is helped for all lookup fields except – customerid.


For customerid field you need use another javascript code:


setTimeout('ChangeCustomerIDHandler();', 1000);


Inside ChangeCustomerIDHandler function we overwrite CRM onchange handler 


for customerid field.


function ChangeCustomerIDHandler()
{
    var control = crmForm.all.customerid;
    if (control != null)
    {      
         control.onchangeHandler = Customerid_Onchange;
         control.onchange = function(){Customerid_Onchange();}
    }
}


Where Customerid_Onchange  is javascript function, that provide needed functionality.


You need call to this javascript code inside OnLoad event in Incident Entity.


Enjoy.

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *