-
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
5 Reasons Why You Should Say ‘YES’ to Salesforce Mobile App
If you’re in sales, you know how crucial the customer relationship management (CRM) platform is to move dealings through the pipeline. You may have been…
Salesforce Automation Tools - Document Generation Made Easy
While running a business, there are so many important documents and records that need resources and time for their management. In an organization, generating documents…
Top 9 Most Common Mistakes in Salesforce Integration and How to Avoid them
Introduction In today’s scenario, businesses utilize multiple applications to accomplish the work of different departments like sales, finance, HR or operations in the most efficient…
Popular Salesforce Videos
Salesforce + WhatsApp Integration Announcement
Salesforce + WhatsApp Integration Announcement. Watch this video to learn all about the famous Salesforce + WhatsApp integration, if you have any doubts or concerns,…
How To Get Exam Voucher For Salesforce?
Wondering How To Get Exam Vouchers For Salesforce? Join this useful group for Salesforce job & career info and learn all you need to know…
7 Tips To Choose The Right CRM For Your Business
A Customer Relationship Management (CRM) system can be overwhelming to choose from. You have so many options to choose from, each offering different tools and…
Popular Salesforce Infographics
All About The Fourth Industrial Revolution | An Infographic
We’re in the midst of the Fourth Industrial Revolution – IoT, innovation and technology are transforming the way we work and customer expectations. Every industry…
Salesforce vs SAP CRM
Although Salesforce and SAP both provide CRM software to the customer, both are still much different from each other. Salesforce is one of the earliest…
AI and Salesforce Einstein Giving Customer Experience A New Direction
This Salesforce infographic will guide you with CEPTES leveraging the power of AI with new strategies and value chains.