-
Help writing my first apex trigger in Salesforce - I have a simple use case in mind
Hello World!
I have a use case that requires a trigger and it sounds about as simple as it gets. We have an external application called BrightTALK integrated with our Salesforce org. Trouble is, we use State and Country Picklists and BrightTALK tries to push Leads into our Salesforce org with Country names that do not match the countries in our Salesforce org. As far as I know, there are two ways to tackle this issue. 1) Change the list of Countries in our Salesforce org. 2) Write a before trigger, which, if I understand correctly, could change a Country value like "China (Hong Kong)" into "China", which our org would then accept because the value matches a value in our State and Country Picklists setup.I have never written a trigger before, and I took one programming class 10 years ago. Does anyone have any recommended places to start, sample code to look at, reference material to refer me to where I can see the methods available to me in an before trigger and learn some syntax? Any help is much appreciated.
Log In to reply.
Popular Salesforce Blogs
Salesforce Tips for Managing Your Data Cleaning Process Effectively
In the current business environment, data is an asset that can dictate the success or failure of your business. You can utilize data to make…
What is workflow automation and what can it do for me?
The one thing you're guaranteed to find in every active instance of Salesforce.com is interaction. It is a given that your users will add,edit,and/or remove data…
Which Salesforce Automation Tool Would You Use For The Following Use Case?
There are several Automation Tools in Salesforce like Workflow Rules, Process Builder, Flows which helps us to automate our tasks using Point and Click Approach…
Popular Salesforce Videos
What are sObjects in Salesforce? | Salesforce Development Tutorials
In this video Shrey not only teaches you sObjects but also demonstrates the use of sObjects in Apex. He explained about the sObjects and how…
Salesforce Confetti | Salesforce Tutorial
In this video, we show you how you can add a confetti cannon to existing paths or create them from scratch. Surprise your staff and…
Salesforce Financial Services Cloud Implementation Guide
You’ve decided to use Salesforce Financial Services Cloud but where do you begin? How can you utilize Salesforce to track all your customer interactions and…
Popular Salesforce Infographics
9 Steps for Building a Useful Price Quote Template
Price quotes are among the most fundamental components of a sales unit’s library, yet too many sales managers treat quotes as a perfunctory measure that…
Salesforce Summer'20 Release - Infographic
Salesforce, the world’s # 1 CRM is always on the lookout to connect to its customers, partners, employees with innovative features all around the world,…
A Four-step Formula for Salesforce Implementation
No matter how big or small your company—or the Salesforce CRM project—success requires planning, commitment, and strong sponsorship from your company’s executive team. It’s also…