


In this post we see how to call Apex Class in Flexcard and Show Account on preview tab.
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);
}
}
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.
Drag data table in canvas .
On Preview Tab Data Is showing in a Table.