-
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
Multipart/form-Data in Salesforce Integration | The Developer Guide
Does Grandmother say you can't post a Multipart/structure information utilizing an HttpRequest in APEX? All things considered, on the off chance that she says this…
No Code Salesforce and HubSpot Integration
Leverage inbound marketing's potential and integrate sales channels to align the internal teams responsible for both operations. Huge opportunities are created by connecting HubSpot and…
Syna World Windbreaker: Where Streetwear Style Meets Everyday Performance
In modern fashion, outerwear has evolved beyond basic protection. Today, jackets and windbreakers represent personality, confidence, and lifestyle. The Syna World Windbreaker is a perfect…
Popular Salesforce Videos
What is Process Builder in Salesforce? Explained Distinctly
Process Builder Salesforce is an automated Salesforce tool which allow you to control the order of action. Watch this video and learn all about it,…
Salesforce Service Cloud Einstein Bots
Learn how to set up and use Einstein Bots to increase case deflection and reduce service costs through self-service. This webinar gives you a guided…
Salesforce Spring ‘21 Release Notes Highlights & Summer ‘21 Preparation
Spring ‘21 Release Notes Highlights & Summer ‘21 Preparation In this session we discussed 00:00 Bella Vista, Western Sydney Developer Group Overview 03:30 Andrew Whitten…
Popular Salesforce Infographics
The Best Salesforce Certifications to Look for in 2020
Salesforce tops the charts across the world in Customer Relationship Management. It is not one of the best, but the best in the game. It is…
Maximize Your Business ROI with Salesforce CRM – The Do’s and Don’ts
Salesforce is The Largest CRM Provider in The World with 19.5% of the market share. Companies that use Salesforce CRM, have experienced: 41% increase in…
How Sales Reps are Staying at the Top of Their Game | Salesforce Guide
Sales reps around the world had to rapidly adopt new methods to work around lockdowns and travel restrictions. In some cases, this meant learning new…