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 :
Microsoft Dynamics CRM (Archived)

Accessing SharePoint from CRM Online plugin

(0) ShareShare
ReportReport
Posted on by 35

Does anyone have a CRM plug-in code sample that accesses SharePoint Online from CRM Online in the same tenant? It should be a no-brainer, so I'm sure we're missing something simple.  The context we're solving for is to fire the plugin from a CRM form to retrieve a file from SharePoint and download to the hard-drive. But we can't get to the meat of it until we can connect to SharePoint from a plugin. BTW, the CRM-SharePoint native integration works fine so there shouldn't be any fundamental setup issues (you would think).

Thank you!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Wendell,

    Yes, after implementing it I can say its not a brainer but will require some additional stuff needs to be done to get/ generate the authentication token. This was already done by Scott Durow and the code is available aslso available.

    Refer the below blog which has all the required links-

    community.dynamics.com/.../creating-sharepoint-folder-automatically-custom-plugin-code

    I hope this helps. If my post answer your questions, please mark it as helpful/ verified.

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    I think that the following article from Rhett Clinton will help you.

    bingsoft.wordpress.com/.../crm-online-to-sharepoint-online-integration-using-rest-and-adfs

    It is based on an older version of CRM Online, but should still work.

    I hope this helps.

  • Andre Margono Profile Picture
    2,602 on at

    your use case mentioned about retrieve a file from SharePoint and download to hard-drive. AFAIK, CRM online won't give you access to save to hard-drive, as all plugins must be registered in isolation (sandbox).

    The most flexible way of developing custom code to SharePoint is using the SharePoint client sdk, however this assembly won't be available as registered dll for CRM Online. The only option if you only have CRM online access is to use the SharePoint REST API using the method that the others have mentioned above.

    The solution that I used in the past that works well is using a custom API, where we can get full flexibility to use the SharePoint client sdk, as well as calling the function specifically from the plugins. this also will address your requirement to be able to store the file in hard disk.

  • Suggested answer
    Syed Ibrahim Profile Picture
    6,257 on at

    Since CRM is online Sandbox plugins we cant access the IO methods (files operation on local drives) & Sharepoint Assemblies. Best way is to write a batch file or windows service to retrive files from sharepoint (through rest API or webservice) and store to any physical locations.

    Reference Links:

    blogs.msdn.microsoft.com/.../sharepoint-web-service-example-grabbing-wiki-content

    blogs.msdn.microsoft.com/.../how-to-download-files-from-a-sharepoint-document-library-remotely-via-lists-asmx-webservice-sps-2003-moss-2007

    hope this helps

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans