Backup_FME_personal/force-app/main/default/classes/CreateAttachmentInvocableHa...

43 lines
1.5 KiB
OpenEdge ABL

global without sharing class CreateAttachmentInvocableHandler {
global class DriveAutomateRequest {
@InvocableVariable(placeholderText='Id of the folder' required=true)
global String resourceId;
@InvocableVariable(placeholderText='Name of the folder created' required=true)
global String folderName;
@InvocableVariable(placeholderText='Name of the cloud service (eg. Google Drive)' required=true)
global String storageType;
@InvocableVariable(placeholderText='Id of the drive')
global String driveId;
@InvocableVariable(placeholderText='Id of the salsesforce record' required=true)
global String recordId;
}
@InvocableMethod(label='HIC : Create Attachment')// iconName='resource:FileMadeEasyIcons:FME')
public static void handleOperation(List<DriveAutomateRequest> request){
system.debug('apex class'+JSON.serializePretty(request));
try{
if(request.size() != 0){
InvocableApexActionHandler.linkFilesWithRecord(request[0].recordId,request[0].resourceId,request[0].storageType,request[0].folderName);
}
String logMsg = ' linked successfully ';
FME_Logger.audit('Link', logMsg, 'CreateFolderInvocableHandler', 'handleOperation');
}
catch(Exception e){
FME_Logger.error(e.getMessage(), 'CreateAttachmentInvocableHandler' + e.getLineNumber(), 'handleOperation');
}
finally{
FME_Logger.saveLog();
}
}
}