Triggers to Create Tasks in Salesforce: Come and See Video

Triggers in Salesforce: CAS Come and See will show you how to write a trigger to create automatic tasks in Salesforce. CAS Come and See videos show you how to customize your Salesforce instance to do amazing things.

Join Jarrett from Cloud Adoption Solutions, as he shows you step by step how you can create triggers in Salesforce!

 

VIDEO TRANSCRIPT:

Hey, guys, it’s Jarret from Cloud Adoption Solutions; today we are going to write a trigger that we actually might use. This one’s going to be on the opportunity, and it’s going to add a follow up task when the opportunity is marked close one. So first, we’re going to start going into the dev console, we’re going to select an apex trigger, we’re going to call it the closed off trigger, maybe not. And call it another closed out trigger.

Alright, and this one is going to work either when the opportunity is created, and marked Closed Won, or after it’s updated to Closed Won. So we’re gonna say after insert after update. So we’re gonna create a new list of tasks. And then we’re gonna populate that list as we iterate through the opportunities. So here, we’re gonna create our iterator and then do a soql query. ID name from opportunity. We’re adding in curly braces on there, so it doesn’t yell at us. And then we’re gonna do a little “if” statement. And check the stage name. It passes that; we’re going to add it to the task list. And here we’re gonna create a new task: Very important follow up task. Then we’re going to use the word ID to relate it to the opportunity.

Alright, here’s the basic functionality, and we’re gonna look at the task list list to see if it is larger than zero. So if it’s not empty: see if this works. No problems for once. Yeah, let’s go check it on opportunity. So we will go into this one. This looks good. All right, we’re gonna close it. And we’re gonna win it. There we go. Very important follow up task. Alright, that’s it.

 

 

Don’t miss this event!

The ONLY Conference for Sales, Marketing, RevOps, and Commercial Executives in the Life Sciences Industry.

Follow Us

Related Posts

Salesforce Sales Cloud vs. HubSpot

Salesforce Sales Cloud vs. HubSpot

In the competitive world of customer relationship management (CRM) software, selecting the right platform can significantly impact your business’s growth and efficiency. Read on to explore the benefits of Salesforce Sales Cloud and HubSpot, and discover how our expertise can support your sales strategy and drive sustainable growth!

The Life Sciences Dreamin’ Trailmix

The Life Sciences Dreamin’ Trailmix

Whether you’re a beginner or a pro, trailmixes are a powerful tool for Salesforce career development. We’re excited to announce our brand new Life Sciences Dreamin’ Trailmix! Dive in and start your learning journey today!