How to Choose An Apex Trigger Framework

How to Choose an Apex Trigger Framework

If you have been programming on the Salesforce/Force.com platform for any amount of time I’m sure you have come into contact with Apex Triggers. If not, Apex Triggers are units of code that execute whenever a database operation occurs. I’ve put together a post about Before and After Triggers that you should read if you aren’t very familiar with how triggers work.

Apex Triggers can get complicated very fast if your company has a very customized Salesforce Org. Apex Trigger Frameworks are a way of offering generic functionality that structures code in a certain way. If you were to use a building metaphor we could say that a framework is the supporting structure of the building – it’s the steel or wood shell that supports the building. Trigger Frameworks are very good at enforcing trigger best practices. Continue reading

How to Sync Quotes using Apex

How to Sync Quotes using Apex

In Salesforce, quotes are a representation of prices that have been proposed to a customer for products or services. If you aren’t familiar with opportunities, quotes and products please review my post about Designing a Sales Process in Salesforce.

An opportunity may have lots of quotes associated to it but only one quote may be synced to an opportunity at a time. Quote syncing links a quote a specific opportunity which allows updates to update between the Opportunity and Quote. Basically, when an Opportunity is added or removed it can be removed from the list of Opportunity Products without having to write any code. Keep in mind that this means Opportunity Products will be automatically removed and readded. I have been confused a few times by this. Continue reading

Apex Trigger Best Practices

Apex Trigger Best Practices

Apex Triggers are very powerful and are easily one of the most important parts of Salesforce because they significantly impact all database operations (inserts, updates, deletes, etc. ) With this incredible power and flexibility there’s a lot of room for problems. In my career as a Salesforce developer, I’ve looked at hundreds of different apex triggers and realized there are a lot of points of failure with apex triggers. This post is a very high level list of best practices and why they are important for apex triggers.

Continue reading

Dealing With Duplicate Data in Salesforce

Dealing With Duplicate Data in Salesforce

Overtime, it’s easy for a Salesforce org to accumulate duplicate Leads, Contacts, Accounts and of course Opportunities. Duplicate data usually means that there’s some bad practices in your sales process or that staff aren’t checking to see if a contact or lead already exists. Companies rarely spend a lot of their time focusing on the data and how clean it is within their systems, but data can be a huge asset when making business decisions. Bad or duplicate data can result in a lot of time wasted by sales staff. Continue reading

Using Basic Email templates from Salesforce Apex Code

Using Basic Email Templates From Salesforce Apex

Sending Emails from Salesforce is pretty easily implemented using Salesforce and the Email Templates. I strongly recommend using Email Templates over visualforce emails and hardcoding text emails within the source code because making changes can be really time consuming otherwise. Of course, there are times when it makes sense to use visualforce emails or hardcoding text emails but these exceptions should not be the norm. Continue reading