web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • gdas Profile Picture
    50,091 Moderator on at

    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>

  • James Profile Picture
    2 on at

    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

    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

    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?

  • James Profile Picture
    2 on at

    Any suggestions, anyone?

  • gdas Profile Picture
    50,091 Moderator on at

    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>

  • Dung Ho Profile Picture
    40 on at

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans