-
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 is the Appointment Setter Role?
An appointment setter is the primary factor of contact among a potential patron and a business. Their primary obligation is to time table meetings or…
Enhance Your Fundraising Efforts by Integrating Your Organization's System With Salesforce
As per Salesforce.org's Nonprofit Trends Report (3rd Edition), the pandemic forced 71 percent of organizations polled to speed up their transition to digital programs or…
Opportunity Line Items in Salesforce - Learn Here
What are Opportunity Line Items? The Products connected to an Opportunity are called OpportunityLineItem. There are many different things that a business might sell. These…
Popular Salesforce Videos
Using Lambdas to Overcome Salesforce Governor Limits
Salesforce is a great CRM product, but it has some limitations that can prove troublesome depending on the situation. Since each org has to share…
How to Create Opportunity Teams | Salesforce Tutorial
Want to give all the people who help out on your opportunities easy access to the opportunity record in Salesforce? Or maybe you've got an…
Salesforce Object Search Language: What is SOSL and when to use SOSL?
When to Use SOSL? Use SOSL when you don’t know which object or field the data resides in, and you want to: Retrieve data for…
Popular Salesforce Infographics
Salesforce Operations/Demographics
Salesforce, the world’s No. 1 CRM Company, has significantly changed the way how business software is delivered and used. Salesforce has found the perfect way…
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…