+ Start a Discussion
kstites1kstites1 

Mass submit approvals

does anyone know how I could mass submit approvals?
werewolfwerewolf
You can do so with ProcessSubmitRequest.  Here's a sample (it's in Java but you can do the same in Apex code or Javascript or what have you).
kstites1kstites1
Can you do it in a button or in a way that a user could utilize it?

ProcessResult[] processResults; ProcessSubmitRequest request = new ProcessSubmitRequest(); request.setComments(comments); request.setNextApproverIds(approverIds); request.setObjectId(id); try { //calling process on the approval submission processResults = binding.process(new ProcessSubmitRequest[]{request}); for (ProcessResult processResult : processResults) { if(processResult.getSuccess()){ if(xconfig.isTraceMessage()){ log.debug("Approval submitted for: " + id + ", approverIds: " + approverIds.toString() + " successful."); log.debug("Process Instance Status: " + processResult.getInstanceStatus()); } } else{ log.error("Approval submitted for: " + id + ", approverIds: " + approverIds.toString() + " FAILED."); log.error("ERRORS: " + processResult.getErrors().toString()); } } } catch (Exception e) { e.printStackTrace(); } return processResults;