tisdag 16 januari 2018

CRM for Outlook and the updated TLS demands

If you're running Dynamics 365 Customer Engagement and having issues with CRM for Outlook, there's an update available which will help.

This update isn't listed on the "update and hotfixes" page from Microsoft https://support.microsoft.com/en-us/help/3142345/microsoft-dynamics-365-updates-and-hotfixes which is sort of strange. If you're running the CRM for Outlook (why is it still called CRM and not Dynamics 365 Customer Engagement for Outlook btw?) and all of a sudden it stops connecting to your online deployment, this is probably your rescue: https://www.microsoft.com/en-us/download/details.aspx?id=56327.
This applies to version 9.0 at least, maybe to 8.2 as well but I'm not sure about that.

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se 


måndag 8 januari 2018

Something happened around new year with Dynamics 365 Customer Engagement Enterprise Edition

Before Christmas we did an integration between an ERP system and Dynamics 365 Customer Engagement Enterprise Edition using the Web API. This integration was running fine until January 3 at 21.32 UTC+1 and by then it couldn't retrieve any data from Dynamics 365.

The only error that was thrown was that one or more errors had occurred and in the inner exception of that it said that "The underlying connection was closed: An unexpected error occurred on a send." and at some other level "An error occurred while sending the request". Not much to go on.

I was pointed to this page by Thomas Sandsør on Facebook (from Microsoft, somewhat safe to open :)) saying that TLS 1.0 and 1.1 will stop working at some time and if you move to .NET 4.6.2 you will be fine.

Now, that didn't quite happen since I still had the same issue running .NET 4.6.2. Digging continues and to my surprise I actually found something at stack overflow (maybe a bit less safe to click on) where they said that you should be able to connect by just using "https" in the connection string but I also found this line of code:"System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;"

Adding that to my code, which it seems I can do pretty much anywhere before I do a call, solves the problem and I'm again able to connect and retrieve data from the Web API.
The funny thing is that I was able to get a token all the time so the authentication actually worked, it was just the GET and PATCH and so on, I guess since the program crashed badly at the GET so I really don't know about the rest but it seems plausable.

Hope this helps.

***Edit
After reading Marius comment below I continued to search for a solution that didn't mean I hardcoded the TLS version which I agree is a ugly solution. This lead me to the following page at Microsoft which says that you have to opt in to get the TLS 1.2 version, that wasn't clear to me earlier so now it works on .NET 4.7 with the following row added to the config file
<runtime>
   <AppContextSwitchOverrides value="Switch.System.ServiceModel.DisableUsingServicePointManagerSecurityProtocols=false;Switch.System.Net.DontEnableSchUseStrongCrypto=false" /> 
</runtime>
 


Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se 

onsdag 1 november 2017

October update of Outlook does some chaos with the Outlook app for Dynamics 365

A customer of ours is having some loading issues with the Outlook app so I was doing a bit of searching to see if there was something that could be done. Now this isn't the issue since the data actually shows but it's still a good piece of info that I'd thought I'd share.


https://support.microsoft.com/en-us/help/4049314/microsoft-dynamics-365-for-outlook-is-unable-to-render-webpages-after

In short, a security update for Outlook makes the Outlook app for Dynamics 365 unable to load data and to resolve this you need to add a registry D-word on the machine that runs Outlook.

It's a bit unlucky that there are clashes between different program's updates but a security update is seldom a bad thing so it's good that there's a work around for it.

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se 

torsdag 5 oktober 2017

Data Sources or Dataset tab in SSDT

This is mainly a note for myself because my SQL Server Data Tool for Visual Studio 2013 keeps hiding the Report Data tab and it takes a good 20 minutes for me to find how to get it back each time.

The magic combination (tm) is Ctrl-Alt-D. I just can't find how to get it back using the menus and I always forget what I should use to search for a solution to this.

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se 

onsdag 4 oktober 2017

Business process error from custom workflow activity

Last week I was working on a custom workflow activity which was reading some data from CRM and returned a string which was going to be but into an email. This shouldn't be a big operation but I still encountered errors which I hadn't seen before.

The error message that was thrown to me was  System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'. Now that's not very informative at all.
Since this was a Dynamics 365 online I'd thought that there might be a ton of stuff that wasn't really working together and I was REALLY going through the code to see what I had written but didn't really find anything weird, just your average custom workflow activity input and output really.

Enter search engine again. https://connect.microsoft.com/VisualStudio/feedback/details/1097462/missingmethodexception-additional-information-method-not-found-0-system-array-empty gave me some pointers where the .NET team responded the following:

Hi

Most likely what is happening is that:
- The code is compiling against .NET 4.6, where the reference assemblies include Array.Empty<T>().
- The Roslyn compiler sees that Array.Empty<T> is available and so uses it when generating the empty array needed for the params.
- The compiled app is trying to run on .NET 4.5 where Array.Empty doesn’t exit.

If the above is not the case, please let us know. Otherwise, this is by-design.

Thank you,
Alex
.NET Framework

Ok, that was at least pointing to somewhere. I was in fact using .NET 4.6 since it was the default version in VS 2015 and I didn't really think about that and I thought that the Dynamics server would support it. When I changed the .NET version to 4.5.1 it started working as I hoped it would so, new stuff isn't always the way to go.

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se 

måndag 2 oktober 2017

Problem updating an 8.0 organization to 8.2

It's been a bit of tumbleweed here the past couple of months due to me being on paternity leave. In my naive mind I thought that I was going to be able to do some testing and blogging while taking care of a one year old, the truth is you don't.
Today is my first day at work and I ran into issues right away while updating an 8.0 organization to 8.2. As usual a cryptic error took me on a bit of a hunt to what was needed and I found a solution which may or may not be ideal but it works so far. 

The error message said "14:41:07|   Info| Setting organization state.  New state = Failed
14:41:07|  Error| Update Organization with Id=84095b00-96bf-e511-80ba-00155d02e703 failed with Exception:
System.Exception: Error.ActionFailed Microsoft.Crm.Tools.Admin.InstallDatabaseUpdatesAction ---> System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.SolutionBase' with unique index 'ndx_UniqueName'. The duplicate key value is (SnapshotSolution80).
The statement has been terminated."

Right. Starting search engine power.
The first thing I found was http://kyledoestech.com/updating-crm-2016-to-dynamics-365-fails-with-duplicate-key-error/ which pretty much says, "restore the org db to a server running 8.1 and update it there, then do an update to 8.2". I don't have an 8.1 server available atm so I was hoping I could do something else.

Next stop, Denmark! "http://crmblog.dk/post/2017/01/03/Dynamics-365-Onpremise-Fejl-ved-opgradering-af-organisation.aspx"
Now, this says that the issue is in the solutionbase table, which the error message says too. There's a section called solution but I don't think that the solution is really stated, but I might be misreading it. It did help a little though since I started looking at what was in that table.

This is very much done at your own risk and is unsupported. So far it is working for me but I didn't have an 8.1 server available so this is a bit of a "hope this will work". I would probably not do this to a production organization but this was a test so I thought it was worth a shot.

What I did was to remove the line with SnapshotSolution80 with the command
delete from SolutionBase where SolutionId = '57A85212-B3B4-4C39-BCB0-5D5EF1F5FFC4'.
It looks like that will be re-inserted and I don't have a quick way of running the update on a 8.1 server too. After the upgrade there is a line with unique name "SnapshoySolution80" but with ha different solutionid so hopefully this has been a good dirty fix. So far I haven't seen any issues with my quick fix but keep in mind this is unsupported.
You could run it towards the uniquiname "SnapshotSolution80", which might be a good idea since there COULD be other lines with the same solutionid

Did I mention that this is unsupported

Oh, btw, this is unsuppported.

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se 

torsdag 16 mars 2017

Install Reporting Services on another machine than the SQL Server

We have faced the question of using an SQL hotel for CRM purposes a couple of times. One problem you could be facing is that the SQL server is hosting several different CRM environments so you needed to install the CRM on a named instance, which of course is possible even with a single installation. Since the SQL server might be hosting several CRMs you needed to install the SQL Server Reporting Services on a different machine.

The Reporting Services doesn't need to be installed on the same machine that is hosting the SQL server and this is a feature that you might be interested in when you are hosting several CRM deployments on the same SQL server. It is possible to host different CRM servers on a single SQL server, although on separate instances of the SQL server, and you can also have separate instances of Reporting Services on that SQL.

The issue is that for the CRM installation you have a component called the Reporting Services Connector that you need to install on the server running the Reporting Services of the CRM system. This software can only handle one CRM server and can only be installed once on a server which means that you can only host one CRM server with a Reporting Services installation so even though you can host multiple CRM servers on one SQL server, you still need one Reporting Services installation per CRM server.
You can install the Reporting Services server on one of the servers used for CRM if you need to minimize the number of servers involved, if you do this you need to think about how your reporting is used because if you do a lot of reporting that server might be loaded and might make the system less responsive for the users.

One thing that's good to know is is that you can't run the reporting sevices service with an account that is used for the CRM installation, i.e. the same account as you're running Asynchronous service with. It is a good thing to have separate accounts for every part of the CRM system, but in this case you are not allowed to use the same account because things won't work.

To install the Reporting Services server on a different machine could also be interesting if you're doing a lot of reporting and you find that the SQL server isn't coping with the load, or you'd like to split them because you'd like to have a lot of power on your SQL server for different reasons but you also want that power to be available for database handling rather than reporting.

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se