web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Note able to retrieve document records stored in Dynamics 365 CDS via DotNet Plugin

(0) ShareShare
ReportReport
Posted on by 110

Hi ,

I have storing my document on sharepoint . As you know that Entity "SharePointDocument" stores document record in Dynamics 365 CRM.

so i want to build some reporting on all documents stored in this Dynamics Entity.

So i tried to build plugin for that and tried to retrieve multiple records from this entity in plugin but its returing zero records. Why it is so ?

Below is line of code i wrote for retrieve multiple document.

var documentsQuery = new QueryExpression
{
EntityName = "sharepointdocument",
ColumnSet = new ColumnSet(true),
};
DataCollection<Entity> docRecords = service.RetrieveMultiple(documentsQuery).Entities;

Any Help will be appreciated.

Thanks

I have the same question (0)
  • Dynamics 365 Sumit Thakran Profile Picture
    110 on at

    Hi ,

    I have storing my document on sharepoint . As you know that Entity "SharePointDocument" stores document record in Dynamics 365 CRM.

    so i want to build some reporting on all documents stored in this Dynamics Entity.

    So i tried to build plugin for that and tried to retrieve multiple records from this entity in plugin but its returing zero records. Why it is so ?

    Below is line of code i wrote for retrieve multiple document.

    var documentsQuery = new QueryExpression
    {
    EntityName = "sharepointdocument",
    ColumnSet = new ColumnSet(true),
    };
    DataCollection<Entity> docRecords = service.RetrieveMultiple(documentsQuery).Entities;

    Any Help will be appreciated.

    Thanks

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Please, don't create duplicated threads in different forums.

  • Dynamics 365 Sumit Thakran Profile Picture
    110 on at

    Point noted.

    Any suggestion on query ?

    Thanks

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Can you try "sharepointdocumentlocation" instead of "sharepointdocument" and also add filter condition as below.

    servicetype Edm.Int32

    Shows the service type of the SharePoint site.

    Display Name: Service Type

    Value Label

    0 SharePoint

    1 OneDrive

    2 Shared with me

    3 MS Teams

    For your case servicetype should be eq 0

    See details here - docs.microsoft.com/.../sharepointdocumentlocation

    If found helpful, Please mark my answer verified.

  • Dynamics 365 Sumit Thakran Profile Picture
    110 on at

    Hi Bipin,

    Thanks for your reply.

    But Entity "Sharepointdocumentlocation" stores location details of sharepoint site. It does not contains doucment records list. As i want to retrieve documents records particular and do some operation based on them.

    I hope i am able to explain my issue here

    Thanks

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Can you confirm if you able to see records from Advanced find. If yes please attach screenshot here.

    Since it is visible from advanced, download fetch xml from advanced and compare entity name with your plugin code.

    Also, can you tell if you have correct permissiion to the user who is executing plugin code?

    If found helpful, Please mark my answer verified.

  • Dynamics 365 Sumit Thakran Profile Picture
    110 on at

    Hi,

    In Advanced find screen also , getting error for this entity .

    pastedimage1595580842823v1.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans