Created
March 2, 2021 07:55
-
-
Save agentgill/ebc40d9144e3d1b79f905d5c9563bf25 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @File Name : Invocable Template | |
| * @Description : Invocable can be called from Flow or other Apex such as Batch or Queuable | |
| * @Author : agentgill | |
| * @Group : | |
| * @Last Modified By : agentgill | |
| * @Last Modified On : 03-02-2021 | |
| * @Modification Log : | |
| * Ver Date Author Modification | |
| * 1.0 07/02/2020 agentgill Initial Version | |
| **/ | |
| public with sharing class InvocableTemplate { | |
| @InvocableMethod(label='Example Invocable Template ') | |
| public static List<Results> doSomething(List<Requests> request) { | |
| List<Results> results = new List<Results>(); | |
| for (Requests req : request) { | |
| Results res = new results(); | |
| updateSomething(); | |
| results.add(res); | |
| } | |
| return results; | |
| } | |
| private static void updateSomething(){ | |
| } | |
| public class Requests { | |
| @InvocableVariable(required=true) | |
| public String recordId; | |
| /* Additional Variables | |
| @InvocableVariable | |
| Implement as required | |
| */ | |
| } | |
| public class Results { | |
| @InvocableVariable | |
| public String errorMessage; | |
| /* Additional Variables | |
| @InvocableVariable | |
| Implement as required | |
| */ | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment