So usually, people go with the integration of Dynamics CRM with SharePoint which reduces the CRM database storage.

We receive many such requests where client wants to move the files from emails or notes attachments to SharePoint.

So while integrating i.e. moving file from CRM to SharePoint, we require SharePoint URL.

For getting the SharePoint URL, we generally retrieve the default site and using this default site we need to generate the absolute URL.

Instead of doing this i.e. retrieving default site, CRM has a request “RetrieveAbsoluteAndSiteCollectionUrlRequest” using which we can get the absolute URL.

This request requires the document location id of a specific entity record. So before executing this request, we need to retrieve the Document Location record which is then passed to “RetrieveAbsoluteAndSiteCollectionUrlRequest” request to get the absolute URL.

As you know, Document location only stores the relative URL. See below screenshot.

Here we take an example of account entity.

Below is the code to retrieve the Document location record against the account.