Callable Interface in Salesforce Apex
With Winter '19 release new Callable Interface has been introduced, which helps in calling methods dynamically between Apex classes or triggers, even for code that works in separate packages. Class has to implement "Callable" interface along with a method "call(String action, Map args)" which has a return type of Object. Below is the sample Apex code using callable interface using. CallableApexTest.apx: /* * Purpose: To test new Callable Interface * Date: OCT302018 */ public class CallableTest2 implements Callable { // Method to return month of the year Integer method1(Date d) { Integer month = d . month(); return month; } // Method to return boolean if passed integer is same as current month Boolean method2(Integer mnth) { if (method1(System . today()) == mnth) { return true; } else { return false; ...