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
Mark RutterMark Rutter 

Get Current Record ID

I want to Call an Apex Class from the Process Builder when the value of a field changes to a specific value.

How do I get the ID of the Current Record in the Apex Class? 
Best Answer chosen by Mark Rutter
PratikPratik (Salesforce Developers) 
Hi Mark,

Here you go:
ApexPages.currentPage().getParameters().get('id');

Thanks,
Pratik

All Answers

PratikPratik (Salesforce Developers) 
Hi Mark,

Here you go:
ApexPages.currentPage().getParameters().get('id');

Thanks,
Pratik
This was selected as the best answer
Mark RutterMark Rutter
Thanks Pratik,

I will try it out.  I was aware of this, but thought it would only work if the Apex class was 'called' from a VisualForce page.
Are you sure this will work if the Apex class is 'called' from the Process Builder?
PratikPratik (Salesforce Developers) 
Hi Mark,

Please try it out and let me know if you face any issues. 

Thanks,
Pratik