function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nandhini S 3Nandhini S 3 

How to find out if an apex class method is called in a process builder?

Best Answer chosen by Nandhini S 3
Hermann OuréHermann Ouré
On the Apex class, you should see the annotation  @InvocableVariable.
Something like that
public class slackRequest {
        //Use @InvocableVariable to call Process Builder
        @InvocableVariable(label='title')
        public String title; 
        
        @InvocableVariable(label='id')
        public String id; 
and an Invocable method similar to this:
@InvocableMethod(label='Publish Community posts to Slack')

Then on the Process Builder, for the immediate action Apex will be selected .
here the variable title and id from the Apex class are set with the value shown below.
User-added image

Hope it does answer your query.

All Answers

ANUTEJANUTEJ (Salesforce Developers) 
Hi Nandhini,

If the question is about calling an apex class from process builder then I can suggest you have a look at the below link:

>> https://help.salesforce.com/articleView?id=process_action_apex.htm&type=5

Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.  

Thanks.
Hermann OuréHermann Ouré
On the Apex class, you should see the annotation  @InvocableVariable.
Something like that
public class slackRequest {
        //Use @InvocableVariable to call Process Builder
        @InvocableVariable(label='title')
        public String title; 
        
        @InvocableVariable(label='id')
        public String id; 
and an Invocable method similar to this:
@InvocableMethod(label='Publish Community posts to Slack')

Then on the Process Builder, for the immediate action Apex will be selected .
here the variable title and id from the Apex class are set with the value shown below.
User-added image

Hope it does answer your query.
This was selected as the best answer