Get a Quote

Hey, do you want to share your amazing ideas with us, drop your requirements, we are keen to work with you on your fantastic project. We will try to reach you shortly, SEE YOU !

Tell us about you

Tell us about your Project

How To Call Apex Class in Process Builder Salesforce

About Process Builder

As we know it’s a point and click tool to setup immediate and time-based action. Its powerful design lets you build and customize the automated process.

Helpful In:

  • 1. Send an Email
  • 2. Call another process
  • 3. Post to chatter
  • 4. Submit for Approval
  • 5. Update/Create records
  • 6. Quick Actions

Also Read: How to Create a Salesforce Lightning Map Component?

Can’t Do:

  • 1. Delete a Record
  • 2. Outbound Message

But you don’t have to worry about this because you can get these jobs done by adding customized functionality to your Salesforce process by calling an Apex call. In this blog, we will learn about calling an Apex code in Process Builder.

Points to Consider

Write your code in your Apex class as a usual class but make sure that you have considered below points:

  • 1. Only Classes that have @InvocableMethod annotation will be listed for selection. Use this annotation at the method level.
  • 2. The method should be static and public or global.
  • 3. A class can only have one method which has this annotation.
  • 4. Can’t use other annotations with @InvocableMethod annotation.

Call Apex Class in Process Builder

Business Use Case

Consider a scenario where we want to call an apex callout for fetching a zipcode while account update basis on Billing state and city.

In order to achieve this, we will create a process builder and write an apex class. Our class looks like.
Public class zipcodeUpdate{
@InvocableMethod
Public static void invokeapex (list acc){
Futureapex.apexcallout(acc[0].billingstate,acc[0].billingcity,acc[0].id);
}
}

Here Future apex is another class in order to make a callout to other service to fetch zipcode basis on billing city and state.

Also Read: How To Connect Pipedrive and Salesforce Integration

author profile
About Author
Author Name:
Virendra Sharma

Certified Magento 2 Consultant

Author Bio:

Virendra Sharma is an ecommerce tech-enthusiast and certified Magento Developer. With a decade of experience in Magento ecommerce development, he has been assisting ecommerce businesses across the globe to harness Magento capabilities by developing, maintaining, and improving clients’ eCommerce websites. A leader in his own rights his teammates see him as an avid researcher and a Magento evangelist.

About Emizentech:

An acclaimed IT solution provider and a leading Magento 2 development company with its expertise lies in delivering top of the line ecommerce solutions, Salesforce commerce cloud services, mobile app development and many more verticals.

Relate Contact to Multiple Contacts
27 May, 2020

How To Relate a Contact To Multiple Accounts In Salesforce

With the Salesforce Summer ’16 release, you can relate a single contact to multiple accounts, without duplication! This is a […]
Read more
Salesforce Development
Chatbots in eCommerce Industry
27 May, 2020

How AI Chatbots Are Benefiting The eCommerce Industry?

Whether you call it a revolution or an intrusion, chatbots have gained a significant place in the ecommerce practices. From […]
Read more
Ecommerce Development
Odoo ERP Integration In eCommerce Platform
26 May, 2020

Odoo ERP Integration In eCommerce Platform: Complete Guide

Who knew that shopping online within just a few clicks would be easier than preparing a cup of tea. Ecommerce […]
Read more
Ecommerce Development

Let’s Talk Business

Reach out to us by following below given details, or simply drop us a text to start a conversation, we are here to provide best in class business solutions.

SAY SOMETHING