Wednesday, November 13, 2013

Clear Integration of MS Dynamics CRM2011 to SharePoint


MS has provided good integration point on MS Dynamics CRM with SharePoint document management. In order to integrate SharePoint document management with Dynamics CRM, you must install CRM List Component on SharePoint and configure Dynamics CRM for SharePoint. I am not going to cover those two tasks from this article and please follow below two articles to complete those two tasks.

1. Introduction to SharePoint Integration with Microsoft Dynamics CRM
2. MS CRM 2011 SharePoint List Component Installation

Even though integration was done fairly well, I encountered that there are few issues with that integration and they are:

Problems:

1. If the primary field of the entity record has no value set, integration to SharePoint document management will be broken for particular record and CRM throws an error with message "Both absolute URL and relative URL cannot be null". It shows that error just because of value of primary field is used create relative URL(folder name in SharePoint Document Library created for the entity) for holding documents saved for particular entity record and it cannot have blank value.

2. If there are two records with same primary field value (e.g. two contacts with same name) in CRM, documents saved will be shared with both the records.

In order to fix above two issues I have come up with solution and thought it will be beneficial for others as well.

Solution

We can create common plugin, which can be registered with any entity that you need SP document management enabled and do below tasks within create method of a plugin to fix above issues. Concept behind the solution is, plugin will create SP document location in CRM and folder in SP up-front, when the CRM record is created. So then when you click on Documents link in CRM record, CRM won't try to create SP document location using value in primary fields and use the detail of a record that have been created by plugin already.

1. Get Sharepoint Parent Site LocationId in CRM using default SP site URL and target entity name.

Guid sharepointParentSiteorLocationId = GetSharepointParentSiteorLocationIdByEntity(orgServiceContext, sharePointURL, target.LogicalName);



2. Create SP folder up-front. Folder name will be GUID of a target entity record.

CreateSubFolder(sharePointInternalURL, target.LogicalName, target.Id.ToString());



3. Create SP document location in CRM. CRM will use these detail to point to a correct location of SP.

CreateSharePointDocLocation(orgServiceContext, target.LogicalName, target.Id, sharepointParentSiteorLocationId, target.Id.ToString());






If you have any question or suggestions on this please feel free to post a comment below.

Cheers....

Tuesday, August 13, 2013

CRM 2011/2013 Custom Validation tool is not loading web resources.

CRM 2011/2013 Custom Validation tool is not loading web resources if the content of any of the web resource is blank. Thanks Linna to find  the issue.



Cheers..

Update FetchXML and Refresh sub grid in supported way on rollup 12 and later

Below function can be used to change the fetch XML and refresh the Grid control. This is 100% tested and working without an issue with even latest UR 14 on IE, Chrome and Firefox. I haven't access the DOM directly here since it is not supported.

function PopulateGridFetchXML(sourceFunctionName, subGridName, fetchXML) {
    var subGrid = Xrm.Page.getControl(subGridName);
    if (subGrid._control.get_innerControl() == null) {
            setTimeout(sourceFunctionName, 1000);
            return;
    }
    subGrid._control.get_innerControl().SetParameter("fetchXml", fetchXML);
    // Refresh the grid
    subGrid.refresh();
}

Cheers,

Tuesday, June 18, 2013

Duplicate views in List of Activity views in Microsoft Dynamics CRM 2011 (to be used asynchronously),

When you imported CRM solutions into  any environment, you might see that activity views have been duplicated.

Below article will show you how to fix that duplicate issue.

http://support.microsoft.com/kb/2637480

--Thsuhara M--