+ Start a Discussion
soma s 6soma s 6 

apex class in process builder

Hi
     I want to use SOQL query in apex class and  get the collection ,If the count of collection is morethan one then only i will call the flow , how to do this, i can write Apex class and get collection , it seems i should declare global variable in apex class and set value if the count is greater than one, am i right please advise.
Pankaj_GanwaniPankaj_Ganwani
Hi,

Please refer the below mentioned link:

https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_distribute_system_apex.htm
soma s 6soma s 6
Sure I will do it, when the process bulder will execute 
will the process builder will trigger if i update/create any record in back end to other obejct also? please advise
thanks
soma
 
SobSob
You don't have to use the process builder. You can just write the custom class and call it from the trigger. In the custom class you can check the collection and if the count is greater than one then invoke the flow within the apex itself.