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 (Figure 8) which holds delete status information for each file record.

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