-
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
Google Sheet Automation Process for Salesforce Data Pull/Push Using G-connector - Part 4
Hi All, Welcome Back --- to another blog related to the G-Connector for Salesforce. A recap for newbies In my first blog of "G-Connector for…
Popular Salesforce Videos
How to Use Customer 360 | Salesforce
See how Salesforce Customer 360, our entire portfolio of technology, unites your team with company data on one integrated CRM platform, delivering the personal experiences…
Salesforce Advanced Code Searcher | Productivity Hack
By using the advanced quick find you can get your code a few clicks shorter. Also, you can search any string your code. Using this…
Setting Up Service Territories and Operating Hours | Salesforce Webinar
Scale your business and ensure optimized performance by setting up service territories in Salesforce Field Service. In Salesforce Field Service, operating hours represent service territory…
Popular Salesforce Infographics
Salesforce Marketing Cloud
Salesforce Marketing Cloud is a platform where relevant and personalized journeys are delivered across different devices and channels. This allows the marketers to deliver right…
Top Benefits of Integrating Salesforce and NetSuite
Salesforce, on the one hand, is the world’s number cloud-based CRM. NetSuite, on the other hand, is one of the best ERP systems. And when…
Dreamforce Facts & Numbers INFOGRAPHIC
We are now just a week away from the biggest Cloud carnival of the world ‘Dreamforce‘. Trailblazers from across the globe will be in San…