-
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
Leverage Salesforce for Building Client Relations
CRM facilitates businesses to build a relationship with their customers that, in turn, generates allegiance and customer engagement. Since customer loyalty and revenue are both…
Spring ’23 New Release Update | All You Need to Know
Spring '23 features that align with the core admin responsibilities are: Release Highlights for Admins Salesforce Admins drive innovation with four core responsibilities: User Management,…
Popular Salesforce Videos
How to Subscribe Salesforce Report in Lightning Experience?
Subscribe Report : We can configure any Salesforce report to run Daily, Weekly or Monthly as HTML email to your Salesforce org. users. Advantages of…
Understanding Leads, Accounts, Contact, Opportunities, Products, Pricebooks objects in Sales Cloud
In this video, I have explained how Salesforce SalesCloud can boost your companies productivity. Some Important object of Sales Cloud : 1. Campaign 2. Lead…
What are lookup filters in Salesforce?
In this video, we will leaarn about Lookup Filters in Salesforce by dividing this topic into 4 basic points, which are: 1. What is a…
Popular Salesforce Infographics
How Customer Experience Is Rewriting the Rules of Business Success
Your guide to customer experience - Customers expectations are changing. And as they change, businesses face sky high standards for delivering customer experience that's a…
See How Building Apps on Salesforce Has Tremendous ROI
The pressure that businesses today are under to reduce costs, improve agility, and deliver better results is no joke. Couple that with rapidly evolving technology…
What You’ll Get with the Salesforce MVP Infographic
We scanned the profiles of Salesforce MVPs, both past and present, searched high, low, near and far to provide insights into what it specifically takes…