FlexCard

How to Call Apex Class In FlexCard

In this post we see how to call Apex Class in Flexcard and Show Account on preview tab.

Step :--1

Creating Apex Class for query account data.

create global apex class  and implements omnistudio.VlocityOpenInterface for calling in flexcard. 

 

				
					global class getData implements omnistudio.VlocityOpenInterface{
global Boolean invokeMethod(String methodName,
 Map  input,
  Map  outMap,
   Map  options
   ) {
   if(methodName == 'TakeAccount'){
   TakeAccount(input , outMap,options );
   }
     return true; 
     } 
      private void  TakeAccount(Map  input,Map  outMap,Map  options){
     
      List  Acclist  = [  select Id ,Name from account limit 5];
      outMap.put('result',Acclist);
}
}
				
			
Step :-- 2

Creating a new FlexCard. In DATA SOURCE > Data Source Type –  Apex Remote.

Remote Class – Here we pass Apex Class Name.

Remote Method –  Here we pass Apex Mathed  Name. 

Step :--3

Drag data table  in canvas .

On Preview Tab Data Is showing in a Table.  

FlexCard
On Preview Tab
Scroll to Top