locked
CRM Javascript not running intermittently RRS feed

  • Question

  •  

    Hi,

     

    We have a experienced a serious problem on our production CRM server where sometimes the javascript for the lead entity does not run. The code has not been changed or updated but it just appears not to run at all while the javascript on the other entities runs without any issues.

     

    We have quite a lot of javascript running on the lead and we have added numerous fields to this entity.

     

    Previously we have done an IIS reset and this appears to fix the problem, but lately an IIS reset only seems to fix the problem for a short while and the javascript stops running soon after. We have even tried rebooting the server, but this only fixes the problem momentarily..

     

    We know that there is nothing wrong with the actual code because it runs after an IIS reset.

     

    Has anyone seen this problem or know why this would happen?.. We are running CRM 4 on W2K3 SP2.

     

    Any help would be much appreciated.

    Monday, September 15, 2008 5:44 PM

Answers

  • Its been about 5 months since the problem last happened to us. We have moved our DB to a new machine and installed various rollups & updates for CRM in the meantime so the problem has either been fixed or masked by all the changes.

    After 8 months of trying to pursue this problem with Microsoft we are closing the support issue because of:
    1. The length of time since last occurrence.
    2. Microsoft unwillingness to do anything unless we remove the unsupported customizations we have in the onLoad() event.

    The unsupported code in the onLoad event hides fields/tabs and in the unlikely cause of the problem since the entire onLoad() javascript is not sent to the client. See example below:
    -----------------------------------------

    tabnTab.style.display = 'none';
    tabnTab.style.display = 'inline';

    nzTab.style.visibility = "hidden";
    auTab.style.visibility = "hidden";
    ukTab.style.visibility = "hidden";

    nzTab.style.visibility = "visible";
    ukTab.style.visibility = "visible";
    auTab.style.visibility = "visible";

    var duplicatesTab = crmForm.all.tab6Tab;
    duplicatesTab.style.visibility = "hidden";
    -------------------------------------------

    I know this doesnt help anyone else having the issue, but I hope for our sake this problem doesnt happen again, and for your sake the problem miraculously fixes itself because there is no real answer. Please note that we have not changed or removed any of the 'unsupported' code shown above.

    Another point I wish to make is that the problem happened to us on 2 entities: lead & email. These are the entities that we have most of in our system. The 'unsupported' customizations are used in almost all other entities in our system, however, this problem has not happened with them.

    In any case I hope this info can help someone else figure out why this is happening.

    Good luck!

    Thursday, April 30, 2009 8:53 AM

All replies

  • HI,

     

    When you say, that iisreset solves the issue momentarily, is this predictable? As in, is there some event after which the javascript stops working? You can  attach a debugger and watch out if the js is not being loaded at your client.

     

    Also, is this happening for the same IE cleint that works fine for some short time after iisreset, or is it for a new IE window that the js does not work?

     

    Monday, September 15, 2008 5:55 PM
  •  

    Hi,

     

    Unfortunately this problem is not predictable. We are not sure what event or sequence of events cause this.

    Basically the symptom of the problem is that the onload() javascript does not run in a new IE window... i.e. everytime a lead entity is opened.

     

    I have also noted that when we republish the lead entity the javascript starts to work again.

     

    Next time it happens I will try to see if the javascript gets loaded at the client.

     

     

     

    Tuesday, September 16, 2008 10:22 AM
  • Hello,

     

    I had a similar problem caused by a field onchange script that had event.returnValue = false. When this script is invoked from the onload script, the onload script stopped executing the script. When I disabled this script, everything opened up correctly.

    So it is possible that an onchange script conditionally stops the execution of the onload script.

    Tuesday, September 16, 2008 11:36 AM
  • Hi,

     

    I've looked at the requests using Fiddler when the lead is loaded with/without the error happening.

     

    There is a request which is of type text/javascript to

    /<orgname>/_forms/FormScript.js.aspx?etc=4&FormType=main&FormName=crmForm

     

    This appears to be the one sending the javascript to the client. Once this request is decoded the javascript can be viewed in TextView.

     

    When the problem is NOT happening there is event attached to the onload of the window which has all our custom javascript in it.

     

    window.attachEvent("onload",crmForm_window_onload0);

    ...

    ...

    function crmForm_window_onload0()

    {

    ... <our custom javascript...>

    }

     

     

    When the problem IS happening this entire function definition and attachment to the onload event is not there at all!!!...

    So it looks like when the problem is happening our custom javascript is not being sent to the client while the CRM defined javascript does get sent.

     

    Tuesday, September 16, 2008 12:29 PM
  • Hi, 

    We are experiencing exact same problem on our production server. We have installed Rollup 1. Did anyone found solution for this?


    Sunday, December 7, 2008 7:56 PM
  • do you have any workflow rules running on this entity?  We have seen cases where workflow stops javascript from running.

     

    Monday, December 8, 2008 12:55 AM
    Moderator
  • Hi,

     

    We have a few workflows on the lead but they are set to run on demand.

    The last time the javascript issue happened I checked if any of the manual workflows had run and they had not.

     

    We have created a support issue with Microsoft but so far there has been no solution..

     

     

    Regards,

     

    Monday, December 8, 2008 2:41 PM
  • HI,

     

    we are also expierecing a similar problem with the execution javascripts. Our application runs in a web farm of 4 servers. In three servers, the execution of javascript is intermittent. after some times, it starts working and again goes off. Not sure what is causing this. This is a critical issue for us.

     

    Has any body got any solution for this?

     

    Thanks

    Bali

     

    Tuesday, December 9, 2008 6:32 PM
  • I am having a similar problem. Have you resolved this? Is your CRM 4 an upgrade from CRM 3?

    Friday, December 12, 2008 5:05 PM
  • Hi,

     

    Yes ours is an upgrade from CRM 3 to 4.

    We had weeks where everything was working fine and all of a sudden it happened again last week.

    I've sent the trace logs when the problem was happening to Microsoft.. They are still looking at it, and no response as yet.

     

    Will update this thread if and when there is some sort of progress.

     

    Regards,

     

     

    Tuesday, December 16, 2008 11:13 AM
  •  

    We are running clean 4.0 install. Last time publish all customizations helped resolve the issue, since then it didnt repeat.
    Wednesday, December 17, 2008 8:35 AM
  • Its been about 5 months since the problem last happened to us. We have moved our DB to a new machine and installed various rollups & updates for CRM in the meantime so the problem has either been fixed or masked by all the changes.

    After 8 months of trying to pursue this problem with Microsoft we are closing the support issue because of:
    1. The length of time since last occurrence.
    2. Microsoft unwillingness to do anything unless we remove the unsupported customizations we have in the onLoad() event.

    The unsupported code in the onLoad event hides fields/tabs and in the unlikely cause of the problem since the entire onLoad() javascript is not sent to the client. See example below:
    -----------------------------------------

    tabnTab.style.display = 'none';
    tabnTab.style.display = 'inline';

    nzTab.style.visibility = "hidden";
    auTab.style.visibility = "hidden";
    ukTab.style.visibility = "hidden";

    nzTab.style.visibility = "visible";
    ukTab.style.visibility = "visible";
    auTab.style.visibility = "visible";

    var duplicatesTab = crmForm.all.tab6Tab;
    duplicatesTab.style.visibility = "hidden";
    -------------------------------------------

    I know this doesnt help anyone else having the issue, but I hope for our sake this problem doesnt happen again, and for your sake the problem miraculously fixes itself because there is no real answer. Please note that we have not changed or removed any of the 'unsupported' code shown above.

    Another point I wish to make is that the problem happened to us on 2 entities: lead & email. These are the entities that we have most of in our system. The 'unsupported' customizations are used in almost all other entities in our system, however, this problem has not happened with them.

    In any case I hope this info can help someone else figure out why this is happening.

    Good luck!

    Thursday, April 30, 2009 8:53 AM