DynCon365 / SharePointDragAndDropPCF

A PCF control to drag and drop files to SharePoint libraries.
MIT License
8 stars 4 forks source link

SharePoint Drag & Drop PCF

A PCF control to drag and drop files to SharePoint libraries.

Configure Azure Active Directory

This control uses Azure Implicit Grant for Authentication. This will require setting up an Azure App Registration so that your PCF control can 'talk' to SharePoint.

Step 1

Create a new App registration in AAD. Enter the URL of your D365 instance (including the 'main.aspx') in the Redirect URI field. Configuration

Step 2

Check the two boxes to indicate that you will be using Access tokens and ID tokens and click Save. Configuration

Step 3

After saving, you will get a warning that you should migrate your URI to a SPA. Click the arrow to the left and then click 'Configure' to move the URI to a Single Page Application. Configuration

Step 4

Next, assign the following API permissions to the App and click the 'Grant admin consent' button. Configuration

Step 5

Before leaving Azure AD, note the Application ID (client id) from the Overview tab of the registration. You will need this later when setting up the control. Configuration

Adding Control to D365/CDS

After your Azure AD configuration is complete, upload the control solution to CDS/D365 and configure a field on the form to render the control.

Note: Turn off the native field label on the control so it renders better.

Step 1

Add the control to the field and set the following bindings:

Step 2

Test the control. Drag and drop one or multiple files onto the control. Configuration

After the files upload, check the Files tab to verify they have uploaded properly to SharePoint. Configuration