Site icon David Lozzi

Integration: Uploading files to SharePoint tightly coupled to Salesforce metadata

Advertisements

This is a multi-part series where we discuss how to integrate SharePoint and Salesforce. There isn’t a one size fits all, I will share a few of the different ways we’ve done it in past projects.

Coming Up:


The first example might suffice for most needs, however, we came across a more targeted need. Lawyers could create dockets, which are official court correspondences for the case, then upload the document and have it tagged with the docket code from Salesforce. We couldn’t let them upload the file directly into a SharePoint library as the docket code and number would be unique for each docket. We didn’t want them to manually enter in the metadata either. Since there would be unique metadata per file, the default column metadata trick we did previously wouldn’t work here.

For this need, we went with a more custom approach. For starters, the docket creation screens in Salesforce were custom VisualForce pages, which was required for the overall functionality but also allowed us to complete the file upload portion of it as well. Upon creating a docket, the user would click a button to add files.

Clicking Add Files would let the user upload files directly into SharePoint.

Note the URL, that’s SharePoint! From here, users could upload files and specify additional metadata. Since this was a docket, we had to validate the file wouldn’t overwrite another file, so we check to make sure the file is legit.

When the files are uploaded, they are placed in a folder for this case, the metadata is set. Meanwhile the user gets a friendly upload status bar. Upon completion, the Salesforce page is notified of the file URLs, and that data is stored in the record and displayed to the user.

We also had an event handler on the library, which would deny deleting files in the Dockets folder, across all cases. If they deleted a docket in Salesforce (which only admins could do) then the file would be deleted from SharePoint via the APIs.

High Level Design

Some technical details

 

Exit mobile version