Triggers – Helping to catch duplicates
Triggers - Helping to catch duplicates. One way in which triggers can be of great help is by using them to catch duplicates records before insertion or before doing an update. Probably the easiest way to do this is by making sure you have implemented a unique key identifier on those records that you want to control and make sure that will not contain any duplicates. The unique identifier needs to be, well... 'unique', and no other record should contain that same key. Depending on the object in which you want to implement your "duplication preventer" you need to come up with that field that will contain your unique identifier. Let's take the Lead object for our test here, and I am going to use two unique values fields. Normally…