Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Unanswered

How to retrieve SharePoint Document details for particular record in MS CRM using FetchXML from Azure API?

Posted on by 5

We have a case where we need to retrieve sharePoint Document details for particular record in Microsoft CRM, we need exactly two information from the record which are the filename and regardingobjectid (to whom this document belongs to).

I found this post: https://mscrm16tech.com/2020/09/09/get-sharepoint-document-details-for-particular-record-in-ms-crm-using-fetchxml/ I followed the same approch and i used the fetchXML in c# console program it worked as expected but the probleme when I created an API in azure APIM which will communicate with dynamics to get the results of the fetchXML, here is the policy that I have created:

    
        
        
        
    
    
        
    
    
        
    
    
        
    

When I test the API I get this error message (statuscode 500)

{
    "error": {
        "code": "0x80060761",
        "message": "Failed to connect to SharePointSite.",
        "@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionSourceKey": "Plugin/Microsoft.Crm.ObjectModel.SharePointDocumentService",
        "@Microsoft.PowerApps.CDS.ErrorDetails.ApiStepKey": "310eac79-cd86-4cbb-a17b-b71c2c7fa136",
        "@Microsoft.PowerApps.CDS.ErrorDetails.ApiDepthKey": "1",
        "@Microsoft.PowerApps.CDS.ErrorDetails.ApiActivityIdKey": "107d7d21-d48c-450b-ad87-88ccb7cc890b",
        "@Microsoft.PowerApps.CDS.ErrorDetails.ApiPluginSolutionNameKey": "System",
        "@Microsoft.PowerApps.CDS.ErrorDetails.ApiStepSolutionNameKey": "System",
        "@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionCategory": "SystemFailure",
        "@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionMessageName": "SPConnectionFailure",
        "@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionHttpStatusCode": "500",
        "@Microsoft.PowerApps.CDS.HelpLink": "http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException:80060761&client=platform",
        "@Microsoft.PowerApps.CDS.InnerError.Message": "Failed to connect to SharePointSite."
    }
}

NOTE: I checked the URL in the browser (with the same fetchXML) and it worked without a problem also the authorization token was added successfully! also I get the same problem when I tested it in Postman.

What is the problem? I really don't know what to do here, any help will be appreciated.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,246 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,041 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans