createShortcuts
This method is used to create shortcuts of files.
void createShortcuts(String destinationObjectFilePrefix, String
destinationObjectFileName, String destinationRelationshipName, String
destinationObjectId, String sourceObjectFilePrefix, String
sourceObjectFileName, String selectedFolder, List<String> fileIds)
Â
Parameters:
destinationObjectFilePrefix:Â This is the object's prefix where you want to create the shortcuts. For S-Drive file objects included with the managed package, provide "cg__" for this parameter.
destinationObjectFileName:Â This is the object's name where you want to create the shortcuts.
destinationRelationshipName:Â This is the relationship field's name between the file object and its parent. For your custom objects provide "Parent__r", for objects included with S-Drive managed package, provide the Master-Detail relationship or Lookup relationship name.
destinationObjectId:Â The parent record's ID where you want shortcuts to be created.
sourceObjectFilePrefix:Â The prefix of the object of the source/original files that shortcuts will be created from.
sourceObjectFileName:Â The name of the object of the source/original files that shortcuts will be created from.
selectedFolder:Â If you want to put the shortcuts into a specific folder in the destination, provide the ID of the folder that you created in the target record's S-Drive.
fileIds:Â The source/original files' IDs in a List<String> format.
Return Value:Â The method does not return anything.
Example code:
The example code will create shortcuts as Account File records and put them under the specified Account which has the accountID. The shortcuts will be created from Case Files which have caseFileIds.
String accountID;
List<String> caseFileIds;
cg.SDriveTools.createShortcuts('cg__', 'AccountFile__c', 'Account__r',
accountID, 'cg__', 'CaseFile__c', ‘’, caseFileIds);