-
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
Reliable AWS Consulting Services for High-Availability Cloud Platforms & Cost Efficiency | Goognu
Goognu delivers reliable AWS Consulting Services to help organizations build highly available, secure, and cost-efficient cloud platforms on Amazon Web Services. Our AWS-certified consultants specialize…
Salesforce Email Studio - Everything That You Need to Know
Email marketing is one of the most effective forms of marketing in the digital age. By using powerful email marketing tools, you can target and…
Leverage our Salesforce Customization Services to Reach Your Business Goals Faster
When it comes to practical CRM, nothing can contend with Salesforce. With whooping revenue of $5.38 billion in the 2021 fiscal year, this CRM management…
Popular Salesforce Videos
Google Gantt Chart with Colorful Bars in Salesforce Lightning
In this video, you will learn to implement the Gantt Chart with colorful bars in your Salesforce org. We will use Google Gantt Chart scripts…
Salesforce Marketing Cloud Connect: Subscriber Key Migration
We demo how leveraging a subscriber key migration to remove duplicate subscribers from Sales or Service Cloud in Marketing Cloud while minimizing data loss. Explore…
Create Targeted Campaigns w/ Marketing Cloud Advertising | Salesforce Demo
Explore the power of using 1st party data to power ad audiences across the most popular ad channels today, including Google (Search, Shopping, YouTube, Gmail),…
Popular Salesforce Infographics
CRM Solutions for Travel Agencies: Enhancing Customer Experience and Operational Efficiency
CRM Solutions for Travel Agencies: Enhancing Customer Experience and Operational Efficiency In the ever-evolving world of travel, customer expectations are higher than ever. With the…
Key Benefits Of Using Salesforce CPQ
Improves productivity and efficiency with Salesforce CPQ. Automate contract amendments, usage pricing, and renewals using an innovative billing feature of Salesforce CPQ Still have a…
How to Increase Employee Productivity Without Increasing Stress?
Are you looking for ways to increase employee productivity? Want to do it without cracking the whip and making everyone unhappy? Salesforce share their productivity…