-
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
Salesforce ERP Integration – Evaluate Your Sales Opportunities Accurately
Vendors that respond faster gain more business opportunities. This is why companies must empower their sales reps with instant customer and prospect information access by…
Learn About These Salesforce Best Practices
Defining best practices in Salesforce is never going to be an easy task, as Salesforce itself contains so many things, from developing a code to…
Salesforce Projects: Let's Spot the Trouble Before It Starts!
Imagine building a house. You wouldn't just start hammering without a plan, right? You'd check the soil, consider weather, and make sure you have the…
Popular Salesforce Videos
Salesforce Flow Best Practices: Salesforce Flow Design Patterns
Salesforce Flow Design Patterns from Fundamentals to Mastery. In this session, we will talk about the top 10 Salesforce Flow best practices. We will talk…
Exploring Technology Choices For Salesforce Integration
Are you struggling to find the perfect technology to integrate Salesforce into your business processes? Integrating Salesforce into your business processes can offer significant advantages,…
Predicted Job Growth of Salesforce Business Analysts
In this video, Ben Analyst predicts the potential future growth of Salesforce. He compares the growth of Salesforce to other companies' growth rates and also…
Popular Salesforce Infographics
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…
The Deluge of Data — And What to Do With It
Data is defined as “facts and statistics collected together for reference or analysis,” and it is everywhere. It comes from transactions, industrial equipment, apps, sensors,…
Salesforce Summer'20 Release - Infographic
Salesforce, the world’s # 1 CRM is always on the lookout to connect to its customers, partners, employees with innovative features all around the world,…