Skip to main content
Skip table of contents

createShortcuts

This method is used to create shortcuts of files.

CODE
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.

CODE
String accountID;

List<String> caseFileIds;

cg.SDriveTools.createShortcuts('cg__', 'AccountFile__c', 'Account__r',
accountID, 'cg__', 'CaseFile__c', ‘’, caseFileIds);


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.