-
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
6 Best Practices While Implementing Salesforce Sales Cloud
Sales Cloud is one of the most prominent offerings in the Salesforce ecosystem and has a proven track record of transforming the sales pipeline and…
How to Import Salesforce Data in Marketing cloud?
How to Import Salesforce Data in Marketing cloud? Note - Before Importing the data you need to check your marketing cloud is integrated to salesforce…
Why Digital Transformation is Essential for Business Growth? | Salesforce Guide
With reports suggesting that worldwide spending on the technologies enabling digital transformation is forecast to reach $2.3 trillion (£1.8 trillion) in 2023, more and more…
Popular Salesforce Videos
Salesforce Integration Crash Course | The Ultimate Guide to Salesforce Integrations
In these 100 minutes, you are going to learn almost all the integration concepts with the help of 2 projects. You will learn about API,…
How to Find Volunteer Work as a Salesforce Professional
In this video, Brad discusses how to generate work experience through volunteer jobs. These jobs allow for new professionals to gain Salesforce specific, applicable knowledge…
Popular Salesforce Infographics
Salesforce Pro Suite: Streamlining CRM for Small Businesses
Salesforce Pro Suite is CRM (customer relationship management) software specifically designed for small businesses. It combines various tools for marketing, sales, customer service, and commerce…
Sales trends and performance: ANZ versus global
Technology is pushing customer expectations to all-time highs and sales organisations into uncharted territory. Organisations worldwide are coping differently as sales trends change operations. Sales…
9 Ways Salesforce Brings Companies and Customers Together
As the world’s #1 CRM, Salesforce brings companies and customers together. This is possible through Salesforce Customer 360. It’s an integrated, AI-powered customer relationship management…