Search

Antony Ellis Dynamics 365 CRM

The blog where Microsoft Dynamics 365 knowledge is shared and development made easier

Category

Browsers

Chrome Debugger Error

Like the Dinosaur if we don’t continually learn and adapt we run the risk of becoming extinct. For most of my career I have always used the IE debugger for JavaScript despite knowing that Chrome DevTools was far better with richer features and generally quicker to use.

Why?

Guess I had a reluctance to move away from that which is familiar to me as JavaScript development has never been my favorite language though times are starting to change! I have made the move now to Chrome not only because the debugger is much nicer but for CRM there a number of great Chrome extensions to help increase my productivity and I never liked having to switch across different browsers just to develop in CRM. Every browser has its own nuances especially when working with Dynamics 365 so the less browsers I have to use the better!!.

Chrome Debugger Broken

Unfortunately, I was caught out by an issue recently which frustrated my adoption of it. I’m unsure of the cause is down to CRM, Chrome or a combination but when trying to debug some code Chrome would not highlight the line both when it went to the break point and afterwards when trying to step through the code. It only happened when I included this line within a HTML web resource.

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

Yet the IE debugger worked fine and as expected (makes a change!).

Here is what it looked like!

Not working the code line is not highlighted

Then we remove the JS include and everything is fine:

Current line is highlighted in Chrome debugger

Ar first I thought a workaround was to place the code in a separate JS file. That works fine for when calling functions in that library but if the web resource has JS code within it too that you need to step-through you are out of luck my friend. At time of writing I don’t have an older VM available to test but I am sure this issue only occurs in the following scenario:

D365 Online v9.1.0.9228 + Chrome (v77.0.3865.90) + HMTL Web Resource and trying to include the Global Context library.

Otherwise how would anyone be able to debug there web resource code using Chrome if the JavaScript is inline with the HTML? Then the light bulb moment finally arrived… it would be highly unlikely in a real world scenario that it would be done this way in first place! If you look at the SDK samples (E.g. JavaScriptRESTDataOperations) the HTML web resource has no inline script it is all done via other libraries namely

  • SDK.REST.js
  • JavaScriptRESTDataOperationsSample.js

Plus, now that I come to think about it I have always avoided inline JS code where possible and favored reusable / encapsulated code within appropriate libraries.

What’s the lesson

I have spent a serious amount of time trying to understand a problem, that is highly unlikely to ever actually be a damn problem in the first place. Well done me! Take a bow Antony Grrr.

Internet Explorer does not support this feed format Dynamics 365

This error message is not specific to just Dynamics 365 when trying to view entity records within Internet Explorer put any server application depending on how it publishes the ATOM feed XML information and the browser settings when it comes to display.

Organisation Data Service

For the purposes of this article showing this based on a Dynamics 365 organisation but to be clear this service has been deprecated and the service should not be used. Use the Web API for all such calls.

/XRMServices/2011/OrganizationData.svc

Scenario

This can occur when trying to view a specific record that you retrieve from the Organisation Data Service endpoint in the IE browser. Using the convention https://YourOrganisation.crm11.dynamics.com/XRMServices/2011/OrganizationData.svc/ContactSet(guid’fef219f0-6bd4-e911-a815-000d3a0b81d4&#8242;). However just doing this at Entity Level (OrganizationData.svc/ContactSet) would show very basic information but avoid the error completely. This article will show you the default behaviour so you can see the differences and understand what is going on.

Internet Explorer (Default)

https://YourOrganisation.crm11.dynamics.com/XRMServices/2011/OrganizationData.svc/ContactSet

IE-Feed

Other than the contact.fullname value no other attributes are displayed. Plus, if you try to query a specific contact this will give you the browser error e.g. https://YourOrganisation.crm11.dynamics.com/XRMServices/2011/OrganizationData.svc/ContactSet(guid’fef219f0-6bd4-e911-a815-000d3a0b81d4&#8242;)

IE-notworking

To fix this uncheck the “Turn on feed reading view” option

ie-chanage.PNG

Then VOILA

ie-working

Now that you have made this change you will also get more verbose information too when querying the EntitySet directly example ContactSet sometimes this can be useful when looking for a quick reference to other other lookup GUID’s etc.

ie-full

Google Chrome

This behaves in the same way automatically so there is nothing more to say here.

How about Web API?

So if using the Web API, Chrome will automatically give you the JSON output in the browser and is much more readable as seen below.

chrome-json

Whilst the Organisation Data Service supports both ATOM and JSON, Internet Explorer by design does not output JSON in the browser window and instead will prompt you to download the response.

This is standard behaviour and the basic recommendation is to associate .JSON files on your system with Notepad/Notepad++ and then open when prompted from within IE. There are other ways around it but none of them ideal such as:

  • Change the response mime-type header to text/plain (not ideal at all)
  • Change your registry settings (not ideal at all) as means all server responses treated in this way

The only really viable options are:

  • Associate JSON extension with notepad
  • Use Fiddler and the JSONViewer plugin to see the JSON format
  • Dont use IE and use Chrome/Firefox instead!

After reading all of that! The best option is to use CHROME! lol. Funnily enough it reminds me of a similar article I wrote here.

Give me strength.

JSON Formatters

If you working with raw JSON format it is often useful to easily be able to convert this to a more readable view so this:

{“@odata.context”:”https://internetschoolofbusinessdev.crm11.dynamics.com/api/data/v9.1/$metadata#accounts(name)&#8221;,”value”:[{“@odata.etag”:”W/\”1247998\””,”name”:”Fourth Coffee (sample)”,”accountid”:”98f219f0-6bd4-e911-a815-000d3a0b81d4″},{“@odata.etag”:”W/\”1247999\””,”name”:”Litware, Inc. (sample)”,”accountid”:”9af219f0-6bd4-e911-a815-000d3a0b81d4″},{“@odata.etag”:”W/\”1248001\””,”name”:”Adventure Works (sample)”,”accountid”:”9cf219f0-6bd4-e911-a815-000d3a0b81d4″},{“@odata.etag”:”W/\”1248002\””,”name”:”Fabrikam, Inc. (sample)”,”accountid”:”9ef219f0-6bd4-e911-a815-000d3a0b81d4″},{“@odata.etag”:”W/\”1248003\””,”name”:”Blue Yonder Airlines (sample)”,”accountid”:”a0f219f0-6bd4-e911-a815-000d3a0b81d4″},{“@odata.etag”:”W/\”1248004\””,”name”:”City Power & Light (sample)”,”accountid”:”a2f219f0-6bd4-e911-a815-000d3a0b81d4″},{“@odata.etag”:”W/\”1248005\””,”name”:”Contoso Pharmaceuticals (sample)”,”accountid”:”a4f219f0-6bd4-e911-a815-000d3a0b81d4″},{“@odata.etag”:”W/\”1248006\””,”name”:”Alpine Ski House (sample)”,”accountid”:”a6f219f0-6bd4-e911-a815-000d3a0b81d4″},{“@odata.etag”:”W/\”1248007\””,”name”:”A. Datum Corporation (sample)”,”accountid”:”a8f219f0-6bd4-e911-a815-000d3a0b81d4″},{“@odata.etag”:”W/\”1248008\””,”name”:”Coho Winery (sample)”,”accountid”:”aaf219f0-6bd4-e911-a815-000d3a0b81d4″}]}

Becomes:

{
“@odata.context”: “https://internetschoolofbusinessdev.crm11.dynamics.com/api/data/v9.1/$metadata#accounts(name)&#8221;,
“value”: [{
“@odata.etag”: “W/\”1247998\””,
“name”: “Fourth Coffee (sample)”,
“accountid”: “98f219f0-6bd4-e911-a815-000d3a0b81d4”
}, {
“@odata.etag”: “W/\”1247999\””,
“name”: “Litware, Inc. (sample)”,
“accountid”: “9af219f0-6bd4-e911-a815-000d3a0b81d4”
}, {
“@odata.etag”: “W/\”1248001\””,
“name”: “Adventure Works (sample)”,
“accountid”: “9cf219f0-6bd4-e911-a815-000d3a0b81d4”
}, {
“@odata.etag”: “W/\”1248002\””,
“name”: “Fabrikam, Inc. (sample)”,
“accountid”: “9ef219f0-6bd4-e911-a815-000d3a0b81d4”
}, {
“@odata.etag”: “W/\”1248003\””,
“name”: “Blue Yonder Airlines (sample)”,
“accountid”: “a0f219f0-6bd4-e911-a815-000d3a0b81d4”
}, {
“@odata.etag”: “W/\”1248004\””,
“name”: “City Power & Light (sample)”,
“accountid”: “a2f219f0-6bd4-e911-a815-000d3a0b81d4”
}, {
“@odata.etag”: “W/\”1248005\””,
“name”: “Contoso Pharmaceuticals (sample)”,
“accountid”: “a4f219f0-6bd4-e911-a815-000d3a0b81d4”
}, {
“@odata.etag”: “W/\”1248006\””,
“name”: “Alpine Ski House (sample)”,
“accountid”: “a6f219f0-6bd4-e911-a815-000d3a0b81d4”
}, {
“@odata.etag”: “W/\”1248007\””,
“name”: “A. Datum Corporation (sample)”,
“accountid”: “a8f219f0-6bd4-e911-a815-000d3a0b81d4”
}, {
“@odata.etag”: “W/\”1248008\””,
“name”: “Coho Winery (sample)”,
“accountid”: “aaf219f0-6bd4-e911-a815-000d3a0b81d4”
}
]
}

There are several ways to achieve this but I personally use any of the following:

  • The excellent plugin JSTool for NotePad++
  • JSON Viewer provided as an extension to Visual Studio
  • Fiddler – if doing lots with web services just make a request and look at JSON response it will automatically present in a tree view

JSTool for Notepad++

Download here: https://sourceforge.net/projects/jsminnpp/

Now just unzip and copy the JSMinNPP.dll file into your notepad++ Plugin folder and start the application. Its now accessible from menu.

JSONTool Plugin for Notepad++

JSON Viewer

If working within Visual Studio you can install the Extension which will allow you to paste in Raw JSON and reformat plus compare JSON. It’s useful if you doing work in VS. Once installed it is accessible from the Tool menu.

Fiddler JSON Viewer

If all you are doing is wanting to see JSON responses in a friendly format then using Fiddler just for that purpose may be a little overkill! It all depends on what you are debugging or working on at the time. Issue yuor get request in browser, double-click the session and then click on the JSON menu header

Internet Explorer Settings For Microsoft Dynamics

I’ve been meaning to write this post for a while now and by while I actually mean years overdue! Oh Well. Often when working with Dynamics 365 you will encounter issues with Microsoft Internet Explorer (all versions even 11) yes I know its a Microsoft product and one would expect this to work with yet another Microsoft Product – right? wrong. It’s often always wrong unfortunately!.

WARNING – I am about to rant in next couple of paragraphs you may want to skip ahead for the IE Fixes.

No doubt some people will be saying what you mean IE? What you talking about you idiot (steady on mate that’s a little harsh!) – its my fault for not moving on with the times don’t you know the world now runs on EDGE??.

WTF? Does anyone actually use that piece of crap? (Ouch).

IE, Edge or Chrome?

The facts are at time of writing that the world-wide adoption of EDGE hasn’t exactly been very good and in any case IE is still listed as a fully supported browser for Dynamics 365. In an ideal world IE would work with another Microsoft product (i.e. CRM/365) without having to make loads of browser setting changes! AND Edge would be be more popular than IE! BUT alas this is not the case is it? EDGE is technically better than IE and quoted as being more secure because IE is old, decrepit and is effectively a Compatibility mode application. Chrome is just awesome, the development experience is much nicer I think in Chrome (When it works with D365! See Oct 2018) thanks to the numerous extensions plus its easier to run browser sessions to different tenants in parallel through Chromes Profile switcher. Whilst we are discussing chrome here are some nice extensions I like to save time:

  • Dynamics CRM Power Pane
  • LevelUp
  • Extension for Dynamics CRM
  • CRM Javascript Fiddle
  • ClearCache
  • ModifyHeaders

Fixes and Changes

Move to Chrome! Here is a quick reference containing a bunch of sweeping changes you need to make to ensure small things like (you know) POPUP windows actually work in the application and you are able to (you know) customize a form layout?!? As without compatibility settings you may find you can’t even drag and drop components onto a form. BIG CAVEAT here… it may vary depending on what version of CRM you are working on and your version of IE but generally in my experience all these settings need to be set.

Typical Issues you may encounter

  • Popup windows don’t open
  • You are not able to login to Dynamics CRM
  • You are not able to customize a form (The components when trying to move on a form don’t stick)
  • Legacy forms don’t load or display correctly
  • Too many more to list I am depressed enough
  1. Compatibility View- add your CRM URL to the list; use *.yourdomain format to cover all possible subdomains or *.dynamics.com if online:
Compatibility view settings IE 11

2. Pop-up Blocker – enable pop-up blocker if it is not already on.

Add *.yourdomain format to cover all possible subdomains or *.dynamics.com if online to the exclusions list

You get the idea!

3. Internet Security : Security Tab : Trusted Sites

Add *.yourdomain format to cover all possible subdomains or *.dynamics.com if online.

Under Trusted Sites: Custom Level – enable the option “Allow Display of Mixed Content”

3. Clear IE cache, exit, verify no other instances of IE are running, re-launch IE and test login to CRM

4. For a more thorough cleanup of cache and other temporary files, run a maintenance application like CCleaner (Piriform).

5. Close all IE browsers and restart the application. At this point I often run IE initially by right clicking on it and selecting “Start InPrivate Browsing” once that works as I expect then I close the session down and start a normal browsing session and ensure behavior is as expected. If you still having login issues you can go into Web Credentials and clear out dynamics tokens and try again sometimes this helps but typically you may only come across this if you are accessing multiple Dynamics 365 tenants at the same time and that is an article for another day! Hopefully not years this time.

Check out my other article on how to view web service responses within your browser and the differences: Internet Explorer does not support this feed format Dynamics 365.

Other Links

https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/178703/dynamic-crm-will-not-work-in-either-edge-or-ie11

https://community.dynamics.com/crm/b/gustafscrmblog/posts/supported-browsers-update

Website Powered by WordPress.com.

Up ↑