Signature
global static void upload( List<Types.UploadSalesforceFilePayload> files, String runAs )
Parameters
| Parameter | Description | |
|---|---|---|
files |
required | List of Types.UploadSalesforceFilePayload objects, one per Salesforce file to copy. |
runAsString |
required | Email Id of the user on whose behalf the function should run. To run the action as the automation user, supply integrationUser. |
Return Type
void — after a file is successfully copied, a Salesforce File Copied platform event is published. You can use this event as a trigger in Apex or flows to delete the Salesforce file using the delete SObject method.
Example
List<cldfs.Types.UploadSalesforceFilePayload> inputs = new List<cldfs.Types.UploadSalesforceFilePayload>{ new cldfs.Types.UploadSalesforceFilePayload( '069DO000000hwB8YAI', 'sharepoint', '01PLJOYLOAWJBFGBSE7FHK5AKOSIMDIO6H', 'b!ZfA15HRS1Uy9pH3Vw5tFjAHfP1lRYlZAvDwLnHYYq8sa-L6ejXB-TJbMYUxi1QfL', null ) }; cldfs.Client.upload(inputs,'integrationUser');