Skip to main content
Skip table of contents

deleteFiles

This method is used to delete files stored as attachments or under S-Drive folders.
List<ResultObject> deleteFiles(List<ID> wipIds, String objectId)
Parameters:
wipIds: List of Salesforce.com IDs of "file" records (either attachments or S-Drive Folder files).
objectId: Id of the parent object. You can use 15-character or 18-character Salesforce.com ID.
Return Value: The method will return a list of ResultObject which holds delete status information for each file record.

ResultObject
String status {get;set;} // success – fail
String errorMessage {get;set;} // null if status is success
String wipFileId {get;set;} // to see which file failed

Example code:

CODE
List<Id>wipIds = new List<Id>();
wipIds.add(ID.valueOf(uploadRequestInfos .fileWipId));
List<cg.ResultObject>resultObject=cg.SDriveTools.deleteFiles(wipIds, objectId);

If you enable versioning and add a latest version file id into wipIds list, all versions of that file will also be deleted. You can also delete a single old version file by adding its id into wipId list.

JavaScript errors detected

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

If this problem persists, please contact our support.