Call Apex Class Using Integration Procedure within OmniStudio (salesforce / vlocity / OmniStudio)

Call Apex  Class In Integration Procedure 

Frist write  Apex Class For Query 5 account Data

Apex Code For Call Integration Procedure 

In Apex class Create Global and implements Callable

 

				
					global without sharing class ClassCalledFromIP implements Callable {
    public Object call(String action, Map<String, Object> args) {
        Map<String, Object> input = (Map<String, Object>) args.get('input');
        Map<String, Object> output = (Map<String, Object>) args.get('output');
        Map<String, Object> options = (Map<String, Object>) args.get('options');
        return invokeMethod (action, input, output, options);  }
 private boolean invokeMethod(String methodName, Map<String, Object> inputMap, Map<String, Object> outMap,Map < String, Object > options) {
Boolean   result = true ;
  try {
            if  (methodName.equalsIgnoreCase('getAccount')){
                getAccount(inputMap,outMap,options);
            }Else{
 outMap.put('result','');
            }
        }catch(Exception e){
            return false;
        }  return result;
    } public void getAccount (Map < String, Object > input, Map <String, Object> outMap, Map < String, Object > options){
        List <Account> GetAccountData  = [ select Id , Name  from Account  limit 5]; 
        outMap.put('result',GetAccountData);
    } }
				
			

 

In Integration Procedure 

Remote Class – here we inter Apex Class Name

Remote Method – here we inter Apex Class Method Name

Remote Options — Send options In Apex Class From Integration Procedure 

ADDITIONAL INPUT/OUTPUT/FAILURE RESPONSE > Return Only Additional Output > Additional Output — here we received data from apex class

ResponseAction–

Additional Output — in %%sine we inter RemortAction Element Name:Additional Output == %RemoteAction_CallApex:returnData%

In Preview Tab

Scroll to Top