createFileActivity
You can use SDriveTools API class to create file activities, after configuring the file activities from S-Drive configuration tab.
In order to create file activities using API class call the following methods depending on single file or multiple files:cg.SDriveTools.createFileActivity(fileId, activityType,prefix,objectName,additionalDetails);
The method signature is explained as follows:
Create file activity record for the given file.
@param String fileId Id of the file to record its activity
@param String activityType type of activity
@param String prefix prefix of the file object e.g. 'cg__'
@param String objectName Name of file object which fileId belongs to e.g. AccountFile__c
@param String additionalDetails Additional details for file activity
throws SDriveException throws exception if fileId is empty or File Activity record insertion fails
global static void createFileActivity(String fileId, String activityType,String prefix, String objectName, String additionalDetails)
cg.SDriveTools.createFileActivity(fileId, activityType,prefix,objectName,additionalDetails);
The method signature is explained as follows:
Create file activity record for multiple files.
@param List<String> fileIds the file Ids to record their activity
The rest of the parameters are the same for two methods.
global static void createFileActivity(List<String> fileIds, String activityType, String prefix, String objectName, String additionalDetails)
Note: For Custom Objects, you must create a lookup relationship in File Activity object with that the desired S-Drive file object. You can create the relationship from Setup > Objects > File Activity > Scrolling to "Custom Fields & Relationships" section > Clicking on "New" button > Select "Lookup Relationship" and select your desired file object as "Related To" from the picklist provided.