Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Suggested answer

Sudden Script loading errors across different Dynamics 365 On-premise Organizations

Posted on by 22
Some, but not all users, are experiencing script load errors while using Google Chrome Browser (Version 126.0.6478.127 (Official Build) (64-bit)), but not using Edge. 
There seems to be two types of errors, one is when clicking a record, it just get stuck on loading:
 
 
The second error occurs when navigating from a subgrid or lookup field to another form, the main "scripts" seem to be loaded fine, but related libraries that are also loaded, the functions seems to be missing.
Both errors seems to be related to the CustomScriptsManager
 
 
Error occurs on several different On-Premise installations under the following version: 
Microsoft Dynamics 365Version 1612 (9.0.47.8) (DB 9.0.47.8) 
 
At first i could not reproduce the error (even though i was on the same version of Chrome), but after clearing my entire cache (all time), I was able to reproduce the error as well. 
Uninstall Chrome (and installing v 116) seems to fix the error, but as we have group policy for auto updates, the error starts again as soon as the browser is updated to v126. I´ve searched around, but only found old examples of this, on Chrome version 73, and a much older dynamics release, so i am unsure if the problems are related. 
Do anyone have any insights as to what could be the cause ?
It seems like it could be somehow cache related, as i can only force the error to occur after clearing the cache.
Clearing the cache on Edge however, does not cause the error to occur.
Best regards,
Emil 
  • Suggested answer
    MK-20071142-0 Profile Picture
    MK-20071142-0 3 on at
    Sudden Script loading errors across different Dynamics 365 On-premise Organizations
    Thank you CU11072049-0 
    Your code works for me, but in v 9.0.0035.0012 the function is $Di_1
    In this path :
    C:\Program Files\Dynamics 365\CRMWeb\_static\form\formcontrols.js
    Change the function $Di_1 to this:
     
        $Di_1: function() {
        var ctxt = this;
            if (!IsNull(this.$6Q_1) && this.$8J_1) {
                if (typeof _ISVIRTUALENTITY != 'undefined' && _ISVIRTUALENTITY) {
                    setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD_FROM_EXTERNAL_SOURCE'));
                }
                else {
                    setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD'));
                }
                var l = this.$6Q_1.length;
                for (var i = 0; i < l; i++) {
                   var func = Mscrm.TurboForm.Control.CustomScriptsManager.frameElement.contentWindow[this.$6Q_1[0].$8y_1];
                   if (typeof func === "function") {
                                                                               var $v_0 = Array.dequeue(this.$6Q_1);
                                                                Mscrm.TurboForm.Control.CustomScriptsManager.frameElement.contentWindow[$v_0.$8y_1]($v_0.$9Q_1);
                                                                }
                                                                else
                                                                               break;
                                                 }                                                          
                                                 if (this.$6Q_1.length > 0)
                                                                setTimeout(function() {
                                                                               ctxt.$Di_1();
                                                                }, 100);                               
                                  }
                   }
     
     
    If you don't find the function with this specific name, just search LOCID_PAGE_LOADING_EXECUTE_ON_LOAD_FROM_EXTERNAL_SOURCE  in formcontrols.js 
     
     
    I should notify when you have lots of users and for security reason it's not suggested to disable render-document from here in chrome:
    chrome://flags/#render-document
     
  • Suggested answer
    CU17071458-0 Profile Picture
    CU17071458-0 2 on at
    Sudden Script loading errors across different Dynamics 365 On-premise Organizations
    Hi, we're investigating what is causing this regression from the Chrome side. Can anyone here clarify what the repro steps is for getting this failure? Which Microsoft Dynamics 365 product is broken here? What were you doing when the error happens? The main post seems to mention "clicking a record" and "navigating from a subgrid or lookup field to another form" -- which page is this in and what kind of setup is needed?

    Feel free to reply here or at crbug.com/352689348
  • CU12072042-0 Profile Picture
    CU12072042-0 on at
    Sudden Script loading errors across different Dynamics 365 On-premise Organizations
    It seems disabling the flag "Enable RenderDocument" in Google Chrome is solving the issue.
    Tested only for a single user so far.

    navigate to chrome://flags/#render-document
    set the flag (Enable RenderDocument) state to Disabled

    Original proposal: https://support.google.com/chrome/thread/283670967?hl=en&msgid=284966458
  • Sudden Script loading errors across different Dynamics 365 On-premise Organizations
    CU12071218-0 on 12 Jul 2024 at 06:33:35 post regarding disabling RenderDocument in testing seems to eliminate the issue.
    That renderdocument function seems to be the cause.
  • CU12071218-0 Profile Picture
    CU12071218-0 on at
    Sudden Script loading errors across different Dynamics 365 On-premise Organizations
    Hi, you can try below, it works for me
    • navigate to chrome://flags/#render-document
    • set the flag (Enable RenderDocument) state to Disabled
    • relaunch the browser
     
    I hope it helps you,
    Grzegorz
  • CU12070335-0 Profile Picture
    CU12070335-0 on at
    Sudden Script loading errors across different Dynamics 365 On-premise Organizations
    Thank you CP-FR-67
     
    I made some minor code changes to make it work on our version of CRM, which is 8.2.5.4
     
    Here is the working code for that version.  (replaced  $5u_1 with $5t_1 ) Check your version and make adjustment as required.
     
    $Cj_1: function() {
                var ctxt = this;
                if (!IsNull(this.$5t_1) && this.$7h_1) {
                setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD'));
                var l = this.$5t_1.length;
                for (var i = 0; i < l; i++) {
                    var func = Mscrm.TurboForm.Control.CustomScriptsManager.frameElement.contentWindow[this.$5t_1[0].$8G_1];
                    if (typeof func === "function") {
                        var $v_0 = Array.dequeue(this.$5t_1);
                        Mscrm.TurboForm.Control.CustomScriptsManager.frameElement.contentWindow[$v_0.$8G_1]($v_0.$8f_1);
                    } else
                        break;
                }
                if (this.$5t_1.length > 0)
                    setTimeout(function() {
                        ctxt.$Cj_1();
                    }, 100);
                }
            }
  • CU11072049-0 Profile Picture
    CU11072049-0 2 on at
    Sudden Script loading errors across different Dynamics 365 On-premise Organizations
    Based on the previous suggestions(tx CP-FR-67), this worked for me, Version 9.0.24.8
    I'm trying to get MS approval for this fix, however I doubt they will sign it.
    They recommended upgrading to V 9.0.53, But I didn't test it yet.
    BEFORE:
        $Dh_1: function() {
            if (!IsNull(this.$6Q_1) && this.$8J_1) {
                if (typeof _ISVIRTUALENTITY != 'undefined' && _ISVIRTUALENTITY) {
                    setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD_FROM_EXTERNAL_SOURCE'));
                }
                else {
                    setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD'));
                }
                while (this.$6Q_1.length > 0) {
                    var $v_0 = Array.dequeue(this.$6Q_1);
                    Mscrm.TurboForm.Control.CustomScriptsManager.frameElement.contentWindow[$v_0.$8y_1]($v_0.$9Q_1);
                }
            }
        }

    AFTER:
    $Dh_1: function() {
           var ctxt = this;
            if (!IsNull(this.$6Q_1) && this.$8J_1) {
                if (typeof _ISVIRTUALENTITY != 'undefined' && _ISVIRTUALENTITY) {
                    setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD_FROM_EXTERNAL_SOURCE'));
                }
                else {
                    setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD'));
                }
                var l = this.$6Q_1.length;
                for (var i = 0; i < l; i++) {
                   var func = Mscrm.TurboForm.Control.CustomScriptsManager.frameElement.contentWindow[this.$6Q_1[0].$8y_1];
                   if (typeof func === "function") {
                                                                               var $v_0 = Array.dequeue(this.$6Q_1);
                                                                Mscrm.TurboForm.Control.CustomScriptsManager.frameElement.contentWindow[$v_0.$8y_1]($v_0.$9Q_1);
                                                                }
                                                                else
                                                                               break;
                                                 }                                                          
                                                 if (this.$6Q_1.length > 0)
                                                                setTimeout(function() {
                                                                               ctxt.$Dh_1();
                                                                }, 100);                               
                                  }
                   }
     
     
  • Sudden Script loading errors across different Dynamics 365 On-premise Organizations
    @CP-FR-67 that is amazing! It is working for me. Thank you!
  • CP-FR-67 Profile Picture
    CP-FR-67 45 on at
    Sudden Script loading errors across different Dynamics 365 On-premise Organizations
     
    You can try this : 
    $Dg_1: function() {
        var ctxt = this;
        if (!IsNull(this.$6P_1) && this.$8J_1) {
            if (typeof _ISVIRTUALENTITY != 'undefined' && _ISVIRTUALENTITY) {
    			setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD_FROM_EXTERNAL_SOURCE'));
    		}
    		else {
    			setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD'));
    		}
            var l = this.$6P_1.length;
            for (var i = 0; i < l; i++) {
                var func = Mscrm.TurboForm.Control.CustomScriptsManager.frameElement.contentWindow[this.$6P_1[0].$8y_1];
                if (typeof func === "function") {
                    var $v_0 = Array.dequeue(this.$6P_1);
                    Mscrm.TurboForm.Control.CustomScriptsManager.frameElement.contentWindow[$v_0.$8y_1]($v_0.$9Q_1);
                } else
                    break;
            }
            if (this.$6P_1.length > 0)
                setTimeout(function() {
                    ctxt.$Dg_1();
                }, 100);
        }
    }
     
  • Sudden Script loading errors across different Dynamics 365 On-premise Organizations
    @cp-fr-67 we have CRM v9.0 and are having the same problem. We are unable to identify exactly what to change because our code is a little different. Can you please suggest a change for us to try? Thanks in advance!
     
     $Dg_1: function() {
            if (!IsNull(this.$6P_1) && this.$8J_1) {
                if (typeof _ISVIRTUALENTITY != 'undefined' && _ISVIRTUALENTITY) {
                    setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD_FROM_EXTERNAL_SOURCE'));
                }
                else {
                    setLoadingText(Xrm.Internal.getResourceString('LOCID_PAGE_LOADING_EXECUTE_ON_LOAD'));
                }
                while (this.$6P_1.length > 0) {
                    var $v_0 = Array.dequeue(this.$6P_1);
                    Mscrm.TurboForm.Control.CustomScriptsManager.frameElement.contentWindow[$v_0.$8y_1]($v_0.$9Q_1);
                }
            }
        }

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans