Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Ctrl key triggers error in Web Resource when ClientGlobalContext.js.aspx

(0) ShareShare
ReportReport
Posted on by 2

Hi all

I've created a new HTML Web Resource, and populated it as follows:

<html>
<head>
</head>
<body>
	<script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
	<div><span>testing</span></div>
</body>
</html>

As you can see, there is nothing in there except the loading of the scripts from ../ClientGlobalContext.js.aspx.

Once this page has loaded, if I press the control key (either of them), I get the following error logged in the console (Chrome below, but I get a similar error in all browsers):

global.ashx?ver=883953442:4024 Uncaught TypeError: Cannot read property 'toString' of undefined
    at Function.Mscrm.Utilities.getResourceValue (global.ashx?ver=883953442:4024)
    at HTMLDocument.Mscrm.GlobalEvents.$6B (global.ashx?ver=883953442:4024)
    at HTMLDocument.b (MicrosoftAjax.js?ver=883953442:2922)
Mscrm.Utilities.getResourceValue @ global.ashx?ver=883953442:4024
Mscrm.GlobalEvents.$6B @ global.ashx?ver=883953442:4024
b @ MicrosoftAjax.js?ver=883953442:2922

It doesn't show to the user (no popup error or anything), but it's annoying for trying to catch my own errors I throw on the page, because I keep intercepting these CRM errors.

Does anyone

  1. have any clue why this error is being thrown?
  2. have any suggestions on a standard or best-practice way of handling CRM Web Resource errors to prevent me catching this error?

This is an on-premise, v8.2 instance. Our dev instance in this case, but it's happening on our live instance, too.

Any help appreciated.

Thanks

*This post is locked for comments

  • Dung Ho Profile Picture
    40 on at
    RE: Ctrl key triggers error in Web Resource when ClientGlobalContext.js.aspx

    Hello,

    I get exactly the same error when working with a web-resource which is opened as a pop-up from CRM form by the following code.

    window.open(url_of_the_web_resource, "_blank", features, false);

    I also take a look to the function "Mscrm.Utilities.getResourceValue" and see that the "window.top.LOCID_JUMP_TO_RIBBON" is undefined at this moment

    Mscrm.Utilities.getResourceValue = function (value, resourceKey) {
    	if (!Mscrm.InternalUtilities._Script.isNullOrUndefined(value))
    		return value;
    	else {
    		var $v_0 = null;
    		switch (resourceKey) {
    		case "LOCID_JUMP_TO_RIBBON":
    			$v_0 = window.top.LOCID_JUMP_TO_RIBBON.toString();
    			break;
    		case "LOCID_JUMP_TO_RIBBON_CONTROL":
    			$v_0 = window.top.LOCID_JUMP_TO_RIBBON_CONTROL.toString();
    			break
    		}
    		return $v_0
    	}
    }; 

    Do you have any update for this error?

    Thanks.

  • gdas Profile Picture
    50,091 Moderator on at
    RE: Ctrl key triggers error in Web Resource when ClientGlobalContext.js.aspx

    I am not sure why this is not working  , just give a try to create another html web resource and add below line in the header , and then add the html in any form of any entity and test once . May be it will helps you to find out the root cause ,  ideally its should work.

    <script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>

  • James Profile Picture
    2 on at
    RE: Ctrl key triggers error in Web Resource when ClientGlobalContext.js.aspx

    Any suggestions, anyone?

  • James Profile Picture
    2 on at
    RE: Ctrl key triggers error in Web Resource when ClientGlobalContext.js.aspx

    Sorry Goutam, I'm not sure what you're asking? I'll try my best: the user logs into CRM, and is presented with a dashboard. There is a link on this dashboard to the page in question. The page is a custom HTML Web Resource.

    Does this help?

  • gdas Profile Picture
    50,091 Moderator on at
    RE: Ctrl key triggers error in Web Resource when ClientGlobalContext.js.aspx

    Hello ,

    Seems its depends on where you are showing your custom HTML web resource , can you please tell me where you are displaying the web resource.

  • James Profile Picture
    2 on at
    RE: Ctrl key triggers error in Web Resource when ClientGlobalContext.js.aspx

    Thanks Goutam. Unfortunately no luck with either suggestion. Removing the "../" resulted in a 404 for the resource, and moving the script tag to the header still gives the same ctrl-key error.

  • gdas Profile Picture
    50,091 Moderator on at
    RE: Ctrl key triggers error in Web Resource when ClientGlobalContext.js.aspx

    Hello ,

    Try with this  , inside header part and removing the "../"

    <html>
    <head>
        <script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
    </head>
    <body>    
        <div><span>testing</span></div>
    </body>
    </html>

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans