-
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
What Role Does Salesforce Play in High-Tech Success?
The high-tech sector is experiencing explosive growth, emerging as a global economic powerhouse. Projections indicate that this industry's global market value will rise to $16…
How Does a Post Install Script Work? - Salesforce Developer Guide
Post-Install Script is the same as other apex classes. And the apex class which is executed when a managed package is installed or upgraded. This…
Why Having a Preference Center is Key to Your Email Marketing Strategy | Salesforce Marketing Cloud
As Marketing Technology consultant, DemandBlue interacts with many digital marketers. Our team audits the full range of digital marketing assets that organizations manage. Based on…
Popular Salesforce Videos
How to Execute a SOQL Query in POSTMAN?
Watch this video to learn how to execute a SOQL Query in POSTMAN. If you have any doubts or questions, let us know in the…
Driving Gamified Interactions on Salesforce Communities With ScoreNotch | Use-Cases
A Salesforce-native, Lightning-ready solution, ScoreNotch enables you to dynamically gamify Salesforce communities. Watch this video to learn more about its use-cases. For more, please visit…
Dynamic Report Charts & Customer 360 View in Salesforce - Learn Salesforce Series By Algoworks
In this video, the following points will be covered - 1. Introduction Introduction to conventional setup for Customer 360. 2. Prerequisites Setting up a base…
Popular Salesforce Infographics
Why Do Business Move To Salesforce?
Salesforce Improves Customer Data Quality & Management – One of the core functions of all CRMs is data management about customers. Salesforce delivers in this…
All About The Fourth Industrial Revolution | An Infographic
We’re in the midst of the Fourth Industrial Revolution – IoT, innovation and technology are transforming the way we work and customer expectations. Every industry…
What is Salesforce CPQ or Configure, Price, Quote – [Infographic]
Enterprises are using various CPQ tools in order to enhance their business efficiency & revenue by engaging their sales reps in doing actual sales activities…