FXCallable
Introduction
FXCallable is an Apex class within the FX5 namespace that utilizes Salesforce’s Callable interface.
FXCallable provides one service, OverrideBatcher.
Parameters
- 
action- 
Type: String
 - 
The action is defined by the Service and method from that service. The service and method are delimited by a period(.).
Example 1. Call the serviceOverrideBatcherand the methodRunOnTicketsString action = ‘OverrideBatcher.RunOnTickets
 
 - 
 - 
args- 
Type:
Map<String,Object> - 
Arguments to be used by the specified
action 
 - 
 
Using OverrideBatcher Service
| If there is no OverrideConfig or Override defined, do not run the OverrideBatcher on a Job or Ticket update. | 
OverrideBatcher has two Methods
| Method | Parameters | Returns | 
|---|---|---|
  | 
  | 
 
  | 
  | 
Example
FXCallable example
public class ProcessOverrides{
	@InvocableMethod(label='Process Overrides' description='Processes Overrides on a job or ticket async' category='Overrides')
	public static void processOverrides(List<ID> idsIn) {
        Set<Id> ticketIds = new Set<Id>();
        Set<Id> jobIds = new Set<Id>();
		for(Id i : idsIn){
            switch on i.getSObjectType().newSObject() {
            	when Job__c j {
                    jobIds.add(i);
                }
 				when Ticket__c t {
                    ticketIds.add(i);
                }
            }
        }
        if(!jobIds.isEmpty()){
            FXCallable callable = new FXCallable();
            SVCResult results = (SVCResult)callable.call('OverrideBatcher.RunOnJobs',new Map<String, Object> {'objIds' => jobIds});
        }
        if(!ticketIds.isEmpty()){
            FXCallable callable = new FXCallable();
            SVCResult results = (SVCResult)callable.call('OverrideBatcher.RunOnTickets',new Map<String, Object> {'objIds' => ticketIds});
        }
	}
}