-
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
Raspberry Pi – Introduction and Setup
Why you need this article? Because we will be doing Salesforce IOT examples in upcoming posts. In this post, we will be getting knowledge about…
Visualforce Vs Lightning - Which to choose and When
Visualforce: The Visualforce framework provides a robust set of tags that are resolved at the server-side and that work alongside standard or custom controllers to…
Can Salesforce help with Project Management?
“As you navigate through the rest of your life, be open to collaboration. "Other people's ideas are usually better than your own." Quote by Amy…
Popular Salesforce Videos
ChartJs Implementation In Salesforce
This was my very first lightning web component I had made on my own. Thought of sharing it 🙂 This component basically shows the no.…
Slack API Integration for Salesforce Marketing Cloud
Connect Salesforce Marketing Cloud and Slack the way you want. Watch this video to learn all about Slack API Integration for Salesforce Marketing Cloud. If…
Is Salesforce A Good Career In 2022?
Wondering whether Salesforce is a good career or not? Still have some doubts about it. Watch this video and join this useful group for Salesforce…
Popular Salesforce Infographics
Boost Efficiency with Salesforce Workflow Automation
Is your sales team bogged down by busywork? Let workflow automation be your hero!Give your team the gift of time!
What are the Benefits of Salesforce CPQ Managed Services?
There are a few benefits of Salesforce CPQ Managed Services that can help organizations maximize their growth and profit margins. Prediction of cost - Salesforce…
How to Build Leads with Salesforce
Salesforce is a force to reckon with when it comes to inbound lead management. However, for certain businesses, especially smaller ones, the various add-ons and…