Wednesday, November 23, 2016

Dynamics 365 weekly reading list 11/23/2016

The big storm of announcements about Dynamics 365 has passed but still some interesting tidbits of information and new tools were released in the previous weeks:

Previous edition – Dynamics 365 weekly reading list 11/05/2016

Tuesday, November 22, 2016

Ignite 2016 slidedeck and video downloader

 

Microsoft Ignite is one of the biggest Microsoft conferences in the year with over 700 different sessions over the course of 5 days so it is quite impossible to attend all sessions. Luckily Microsoft provides a recording of most of the sessions on Channel 9 | Microsoft Ignite 2016 and for those of you who would like to get an offline copy of all the different sessions as well as the PowerPoint decks – take a look at  the Powershell script – Ignite 2016 slidedeck and video downloader  - if you want to download only the powerpoint decks you can use the command  -  .\Ignite2016Downloader.ps1 -NoVideos -DownloadFolder d:\Ignite2016 ,  this is already 12,5 GB.

Here’s my watchlist for the next couple of weeks:

Saturday, November 05, 2016

Dynamics 365 weekly reading list

 

Welcome to the first edition of the Dynamics 365 weekly reading list – with the official “release” of Dynamics 365, Microsoft took an important step in providing an integrated cloud platform which combines CRM and ERP. Follow this blog for your weekly reading list about the Dynamics 365 platform.

Monday, October 31, 2016

Fixing Visual Studio projects created with CRM Developer Toolkit

If you try to open a Visual Studio 2012 CRM plug-in or workflow activity project which was created with the CRM Developer Toolkit in Visual Studio 2013 or Visual Studio 2013 you will notice that it does not open and that it states – “This project is incompatible with the current edition of Visual Studio”. Unfortunately the CRM Developer Toolkit has not been updated to work with the newer versions of Visual Studio. There is however an easy fix for this -  open the csproj file of the Visual Studio project in Notepad++ – look for the ProjectTypeGuids line and simply delete it. This fixed it for me with Visual Studio 2015 – if you encounter other errors – take a look at How to remove dependencies to CRM Developer Toolkit

Tags van Technorati: msdyncrm,Dynamics+CRM,Visual+studio,Microsoft,CRM,development,c#,csharp

Thursday, October 13, 2016

Creating a new Documents view in CRM to display SharePoint documents

Integration between SharePoint and Dynamics CRM allows you to link documents to Dynamics CRM entities but the documents will be stored in SharePoint instead of the CRM database (See Using SharePoint Online to store Dynamics CRM Online Documents for more information). This allows you to take advantages of the strenghts of both platforms but one of the things missing is how you can surface metadata/document properties from linked documents in Dynamics CRM.

In  Showing SharePoint document properties in Dynamics CRM views I  already explained how you can adapt the standard Associated Documents view to show extra document properties from documents stored in SharePoint document libraries. In this post, I will explain how you can create new views for the SharePointDocument entity.



If you just create a new view and try to make it work out of the box you will see that this not works. You will need to export your CRM solution. You will notice that the exported zip file contains three XML files.

  • solution.xml : Contains the details of the solution package including publisher information and a listing of any missing or key dependencies
  • [Content_Types].xml : standard Microsoft export file that identifies the content of the solution. The [Content_Types].xml file type is part of the Open Packaging Conventions (OPC) standard. For more information, see OPC: A New Standard For Packaging Your Data on the MSDN Web site.
  • customizations.xml: this file contains all of the content and mark-up that you will need to change.

Now if you look at the SavedQuery XML from the custom view which I configured in the view editor (left side of the image below), you will notice that it is quite different from the Associated Documents view that I customized previously (See Showing SharePoint document properties in Dynamics CRM views )



For a description of the different XML nodes and attributes used you can take a look at the Saved Query XML Reference but the most notable differences in the Associated Documents grid are the following – and these are also the changes that you need to make in the XML for your custom view.
  • SharePointDocument.RetrieveDocument – the official documentation only states that a string value is expected but not really what value is needed. For integration with SharePoint you need to specify SharePointDocument.RetrieveDocument
  • – defines a set of columns to return in a saved query, it seems that it is necessary to also take over a number of SharePoint specific columns.  (Reference: Saved query XML reference columnsetxml   )
  • (Reference: Saved query XML reference layoutxml )
  • 0  -  0 is for a normal main application view,  2 is for an associated view (Reference: Saved query XML reference querytype )
  • – here you need to specify the additional SharePoint document metadata columns that you want to show in the grid
After you have made the changes to view as outlined above you will see that your custom view will also work correctly. I have added the full savedquery also in Sample SavedQuery download link. In a next post I will outline how you make it possible to modify SharePoint document properties from within the CRM interface.

Related posts:

Wednesday, September 14, 2016

So you want to become a data scientist?

It has been over 4 years that the article Data Scientist: the sexiest job in the 21st century appeared and the interest in a data scientist career has probably increased if you take a look at Google search trends – see https://www.google.com/trends/explore?q=data%20science (although I’m quite puzzled by the high interest in Nigeria).



For those of you out there who have never heard of data science, check out Data science for the rest of us. It has also become easier to get started given the abundance of resources available on the web and MOOC platforms such as Coursera and Edx offer quite a few data science and machine learning courses. Listed below are a number of links to get you started. However keep in mind that if you want to make a profession of this, you will need to put a lot of effort in it – check out this excellent post Stop saying learning to code is easy and just replace “Programming” with “Data Science” and you will get the picture.

Friday, September 09, 2016

Showing SharePoint document properties in Dynamics CRM views

As outlined in a previous blog post, Dynamics CRM provides out of the box integration with SharePoint – meaning that you can upload your documents into SharePoint directly from within the CRM user interface and link them to specific CRM records (See Using SharePoint Online to store Dynamics CRM Online documents for more details). This same integration scenario is also available for Dynamics CRM on-premise and SharePoint Server on-premise deployment.  From Dynamics CRM 2016 onwards it is also possible to use hybrid integration scenarios where as outlined in Setup SharePoint Integration with Dynamics CRM

The preferred method for integration is using Server-to-server integration (See Integrate Microsoft Dynamics CRM CRM with SharePoint) but there are some noticeable differences between the Dynamics CRM List component and server-based SharePoint integration as outlined in Important considerations for server-based SharePoint integration as well as SharePoint Integration Reloaded Part 1 from Scott Durow. From Dynamics CRM

 One of the great features which is enabled using server-based SharePoint integration is the fact that you are also able to show fields (or site columns) which are added in SharePoint within the Documents view in Dynamics CRM. Site columns or library columns (also referred to as fields or attributes) are used to organize documents so that people can find back the documents they need more easily. Document libraries in SharePoint are like real libraries where you can borrow books, a library has a system in place to search for the books by publication year, author, language, genre, age category, etc… In a SharePoint document library you would use site columns or library columns which would contain this information. This is also called metadata – “data (information) that provides information about other data”.  So if you enable document management on the Account entity in CRM using server-based-integration it would look like the screenshot below.  
 Dynamics CRM uses a number of entities to enable the integration with SharePoint :
  • SharePoint site (schema: SharePointSite): represents a location record in Microsoft Dynamics CRM that points to a site collection or a site on a server that is running SharePoint Server (See SharePointSite entity messages and methods )
  • SharePointDocumentLocation : represents a location record in Microsoft Dynamics CRM that points to a document folder on a server that is running SharePoint Server. You can associate the SharePoint document location records in Microsoft Dynamics CRM with the entity records for the entities for which the SharePoint Server integration or document management feature is enabled. (See SharePointDocumentLocation entity messages and methods)
  • UserMapping : represents a custom claim mapping record in Microsoft Dynamics CRM to use a value other than the default value used by CRM Online for authenticating and authorizing CRM users in SharePoint (See UserMapping entity messages and methods)
Next to these three entities which are documented by Microsoft there is a 4th entity SharePointDocument which is actually quite an important entity since it is in the SharePointDocument entity that you can define additional SharePoint columns that you want to be displayed in the grid. Internally CRM will translate the FETCHXML query to a SharePoint query (CAML – Collaborative Application Markup Language ) – if you are interested to know how this is done you can use JustDecompile and take a look at the code in the Microsoft.CRM.ObjectModel.dll which apparently has the implementation code for the SharePoint integration.


If you look at the SharePoint Document entity in CRM and check out the list of fields you’ll see there are quite a few fields (such as Title, version, etc..) that you can display. These fields will display the corresponding values from columns in a SharePoint document library if you add them to the SharePoint Document Associated View. So for example you can quite easily make the title of a document in SharePoint appear in the CRM view.

This is great for the out of the box fields but if you have modified the library in SharePoint to add additional attributes you’ll notice they are not displayed. So let’s image that you have added a custom field called DocType (of type text) in a SharePoint document library as shown below and you want to show the values of this SharePoint column in Dynamics CRM (I suppose that you already setup with document management integration already setup). You will need to perform a number of steps to accomplish this: 
  • Create a new solution in Dynamics CRM (you can also use the Customize the system option but this is not really the recommended way)
  • Add the SharePointDocument entity and the Document Associated Grid to your CRM solution

  • Navigate to the SharePoint document library that is used to store the documents linked to your CRM record and add a column of type text with name “DocType”.
  • Add a field on the SharePointDocument entity with exactly the same display name “DocType” of type single line of text. Dynamics CRM will use the display name of the fields to do the mapping with the query which is send to SharePoint. All values returned from SharePoint will be of type text except for a date field in SharePoint. So you need to create fields of the corresponding type in CRM.
  • Modify the “Document Associated Grid” view that you added to your CRM solution and add the newly created CRM field to this view. (This will only work with the “Document Associated Grid” view – to make this work with new views you will need some extra steps that I will outline in a next blog post)

Once you fill in the values of the SharePoint fields for the different documents you will notice that they appear in the CRM “Document Associated Grid” as well. This seems to work for the following types of SharePoint fields: text, number,date,choice, boolean,currency and person. I currently only tested the scenario in Dynamics CRM Online (8.1.0.452) in combination with SharePoint Online as well as for Dynamics CRM 2016 (Update 0.1) on premise in combination with SharePoint Server 2013 but I guess it should also work in other setups which are using server-based-integration.



References: