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)

Uploading a document to SharePoint using Ribbon button

(0) ShareShare
ReportReport
Posted on by 1,445

Hi,

I have a requirement where I have to upload an image from Ribbon button using JavaScript and upload it to the SharePoint Location of the record.

I am using CRM online and SharePoint online

I have tried the following things

1) Using cross origin scripts provided by Microsoft to upload to SharePoint.

This is not working as it is timing out at 'AppWebProxy.aspx' loading to iframe.

As per my understanding the API doesn't support uploading of document directly to document entity as of now. I can use the dialog used in the Document sub grid and open it from Ribbon button, but that's not the right solution as we don't have much control on what files can be uploaded and also not supported.

I have also aware of the solution to upload the image to notes from JavaScript and then in workflow upload the document to SharePoint. This is also not a good solution. As we have to clean up the notes afterwards.

Can any one please suggest a better solution so that I can upload the image from Ribbon and then upload to the SharePoint.

Any help in this regard is of great help.

Cheers,

Pramod

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Abhishek_Sinha Profile Picture
    665 on at

    Hi,

    Please check below blog . I was able to integrate SharePoint using workflow. Call workflow from ribbon button.

    code.msdn.microsoft.com/SharePoint-Integration-c5f21604

  • Pramod M Profile Picture
    1,445 on at

    Hi Abhishek,

    I have already implemented that and using for some other scenarios. But in the current scenario I have to upload an image from client side and post it to sharepoint. Can you please let me know how this post will help me in that scenario.

    Cheers,

    Pramod

  • Suggested answer
    Abhishek_Sinha Profile Picture
    665 on at

    Hi Pramod,

    Please let me know where are image located . On click of Ribbon button which image one has to select. Also please check below blog as you are using crm and sharepoint online.

    mscrmrocks.wikispaces.com/101+Ways+to+Enhance+Dynamics+CRM+with+Azure

    Thanks,

    abhishek

  • Pramod M Profile Picture
    1,445 on at

    Hi Abhishek,

    Ribbon will open up a dialog where you can select an image (client side) and upload to sharepoint / crm document location.

    Cheers,

    Pramod

  • Tim Dutcher Profile Picture
    2,100 on at

    Yeah, with Azure in the mix: 1) user attaches image to the record 2) message is sent to Azure service bus queue 3) Azure service (Combination of Logic App and Azure Function) gets the message, retrieves the attachment and 4) uses a SharePoint Online connector to store the file.

  • Suggested answer
    JohnAnonymous Profile Picture
    5,241 on at

    If you would want to do this on the client with only javascript, I would assume you have an authentication challenge. If you are authenticated to CRM online, you're not automatically authenticated to SharePoint online.

    It might me doable using AdalJS, but the user would get a popup that asks for authentication to SharePoint online before he's able to upload the document.

    Tim's suggestion would be my preferred method.

  • Verified answer
    Pramod M Profile Picture
    1,445 on at

    Thanks Tim ,Martijn, Abhishek. That's a good solution but more work involved. Currently what I have done is using the OOB document upload dialog, with a mix of action to get the document location if exist or create new if not existing. It works fine but no control on the dialog (ie if I want to restrict the type of image).

    Cheers,

    Pramod

  • Community Member Profile Picture
    on at

    Will the SharePoint Online Connector require authentication with SharePoint?  I guess what I am ultimately asking is, does the Azure-aware plug-in, which is talking to Azure services, pass any authentication token on to 'SharePoint Online connector'?

    Cheers,

    Mark

  • Suraj Kumbhar Profile Picture
    130 on at

    Hi Pramod,


    I have similar requirement, can you please share the code?

    It would be great if you could provide the details about action used too, also how you used OOB document upload dialog.

    Thanks!

    Suraj

  • Community Member Profile Picture
    on at
    1. Use client side file upload, via HTML web resource, to get a base-64 encoded file in memory. scaleablesolutions.com/upload-notes-attachments-using-javascript-and-rest
    2. Use custom action to send this base-64 to a plug-in.
    3. Upload the file to SharePoint from Plug-in. https://code.msdn.microsoft.com/SharePoint-Integration-c5f21604

    Mark



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