-
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
Digitization - The Way Forward For Nonprofits | Salesforce Guide
Digitization is booming in every industry, big or small, after the COVID-19 hit. As companies and organizations are working remotely, this entails signing off the…
What is Salesforce Sales Cloud and What are its Features?
Any organization would require a number of Salesforce's products and services to support and manage its operations. Sales Cloud, Service Cloud, Marketing Cloud, Analytics Cloud,…
Always Implement 2FA when providing web services on top of Salesforce
How many time have you herd the sentence “SECURITY is never enough” ? especially in IT and digital services we always add new fences, walls…
Popular Salesforce Videos
Automate Your App With and Without Code | Salesforce Developer Tutorial
In this video, you will learn how you can automate your business process with and without code. This video teaches you how to use a…
How to Elevate Engagement with Salesforce Experience Cloud?
Salesforce Experience Cloud helps companies create personalized portals for customers to find answers, collaborate, and be part of a community. In this video, ENWAY will…
Introduction to Cloud Pages in Salesforce Marketing Cloud
Cameron Robert from Datarati introduces the Cloud Pages function in Salesforce Marketing Cloud and talks through the different Cloud Page types and how they can be…
Popular Salesforce Infographics
Top 5 Salesforce apps for sales and marketing managers
The sales rep, marketing professionals can effectively manage on the customer inquiries from different geographical areas through Salesforce CRM. Here I’m offering a roundup of…
The 10.5 Commandments of Salesforce Users
This great piece of visual goodness presents the 10 commandments every Salesforce user needs to follow. Make sure every single one of these practices is…
Take a look at the future of CPQ with this infographic!
Business-to-business sales, often referred to as simply B2B, used to be much less complex. But now, there is a lot that goes into these quotes…