-
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
Why Having a Preference Center is Key to Your Email Marketing Strategy | Salesforce Marketing Cloud
As Marketing Technology consultant, DemandBlue interacts with many digital marketers. Our team audits the full range of digital marketing assets that organizations manage. Based on…
Insert and Update multiple custom metadata records through Salesforce Apex.
Hi Folks, as we all know Salesforce has limitations while performing any kind of DML Operation on custom metadata (.mdt) objects records. Even though there…
Automating Sales and Marketing for Small Businesses: Examples to Help You Get Started
Every small business springs up as the result of a great idea. At first, the idea and drive seem to be sufficient for keeping the…
Popular Salesforce Videos
How To Get Job In Salesforce Without Experience?
The scope of careers in Salesforce is increasing day by day leading to rising demand in lucrative job roles like Salesforce Administrators, Salesforce Developers, Salesforce…
Custom Aura Feed Component | forceChatter:feed | Chatter in #Salesforce | Salesforce Tutorials
In this vlog I will create a custom aura feed component with two picklists to select Group and then based on the Group selection, select…
5 Reasons To Choose Marketing Automation For Your Business | Salesforce
With the advancement in technology, it has become imperative to move towards more advanced methods to grow your business. Marketing automation is one method that…
Popular Salesforce Infographics
Enjoy the Salesforce Innovation Management infographic
Without innovation, a company will stay in one place. Without getting ideas from those closest to your product or service - customers, employees, and partners…
Best Practices For Cleaning and Maintaining Salesforce Data [Infographic]
Once you’ve had Salesforce up and running for a while, your system’s data will need to be tidied up. Or if you’re looking to move…
ABC's of Salesforce's Apex Coding Language
Apex is a proprietary language developed by Salesforce.com. It is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control…