-
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
Essential Skills Every Salesforce Admin Should Have
Salesforce is rapidly gaining popularity as a strong ecosystem with its multiple offerings. Every organization that wants a strong tool or platform looks up to…
Why Should Organizations Consider Outsourcing Their Salesforce Development?
As a top-rated CRM, Salesforce can be leveraged by businesses to increase their sales and productivity. Besides helping organizations manage their business processes, the cloud-based…
How Salesforce is Supercharging Customer Experience in Financial Services Businesses
Breakthroughs in new-age technologies and changing expectations of digital-savvy customers are the main contributors to the ongoing revolutionary change in the financial services industry. Be…
Popular Salesforce Videos
Tips to Crack the Salesforce Administrator Certification Exam in One Go
Do you want to become Salesforce administrator certified? So in this video Shrey has shared the important topics to crack the Salesforce Administrator Exam. Following…
Campaigns in Salesforce | Salesforce Tutorial
Salesforce describes campaigns as “a marketing tactic (or series of tactics) that are designed to achieve specific goals such as increased revenue, leads, adoption, etc.”…
Revenue Sharing with Salesforce | Unlocking Profit Potential | Live Stream Highlights
This extract from our live webinar uncovered how this powerful platform can revolutionize your revenue generation and maximize your profits. Discover the untapped potential of…
Popular Salesforce Infographics
Management: Salesforce – 27 Incredible Sales Tips
Get a complete view of your customers, including activity history, key contacts, customer communications, and internal account discussions.. With sales software from Salesforce (Salesforce Sales…
4 Ways to Generate Leads Using Marketing Automation
As businesses gain access to greater amounts of customer data, and consumers themselves have more options for services and products, marketing strategies have become more…
The Evolution of Cloud Computing | Salesforce
Cloud computing services have revolutionized the way we store, host, and share information. Most of the consumer services we use in our everyday lives rely…