Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

This method is used to delete files from the S3 bucket. It does not delete the S-Drive file records, so that needs to be done separately.

cg.SdriveTools.deleteS3Files(List awsLocationList, List versionIdList)

Parameters:
awsLocationList is the Key__c field
versionIdList is the version_id__c fields.

This returns void if the delete is successful and an exception if unsuccessful.

Example code:

List awsLocationList = new List();
List versionIdList = new List();
for(cg__CaseFile__c caseFile : caseFiles){
awsLocationList.add(caseFile.cg__Key__c);
versionIdList.add(caseFile.cg__version_id__c);
}

cg.SdriveTools.deleteS3Files( awsLocationList, versionIdList);


After delete from s3 is successful you should delete the records Salsforce as well like below.

delete caseFiles.

  • No labels