-
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
Troubleshooting and Debugging Salesforce orgs in The Welkin Suite
Even though Salesforce has always been an innovative platform, just a couple years ago our troubleshooting options seemed as they were much more closer to…
What is Case Automation Tool in Salesforce
Let’s Discuss the Main Case Automation Tool Queue: With the help of Queue, It organizes the support team burden by creating a list from which…
Popular Salesforce Videos
AI Cloud: Explore the GPTs of Salesforce
Discover how GPTs, or Generative Pre-trained Transformers, are revolutionizing the way we interact with AI. We break down the complex jargon and show you how…
Predicted Job Growth of Salesforce Business Analysts
In this video, Ben Analyst predicts the potential future growth of Salesforce. He compares the growth of Salesforce to other companies' growth rates and also…
Exploring Salesforce composite Resources | Composite API
Exploring Salesforce composite Resources-- 0:00 Introduction 1:30 What is Composite Resources? 2:00 Composite Resources consists of 2:25 Composite request body 5:30 Composite request response 6:33…
Popular Salesforce Infographics
Enhance Customer Experience With Salesforce
Salesforce Makes Personalized, Consistent Digital Customer Experience a Reality. Salesforce, widely recognized as the leader in business CRM, gives organizations the tools they need to…
Salesforce Admin Mind Map
As you study for your Salesforce Admin exam and certification, rely on this easy-to-use mind map to make critical connections to the information you need…
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…