Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

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

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

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

    Hi,

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

    pastedimage1595580842823v1.png

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Note able to retrieve document records stored in Dynamics 365 CDS via DotNet Plugin

    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.

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

    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
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Note able to retrieve document records stored in Dynamics 365 CDS via DotNet Plugin

    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.

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

    Point noted.

    Any suggestion on query ?

    Thanks

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Note able to retrieve document records stored in Dynamics 365 CDS via DotNet Plugin

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

  • Not able to retrieve Documents records stored in Dynamics 365 CDS via DotNet Plugin

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans