Force.com Best Practices - Triggers


Triggers


·         There should only be one trigger for each object. (Best way to read and understand)
·         Avoid complex logic in triggers. To simplify testing and resuse, triggers should delegate to Apex classes which contain the actual execution logic. See Mike Leach's excellent trigger template for more info.
·         Bulkify any "helper" classes and/or methods.
·         Trigers should be "bulkified" and be able to process up to 200 records for each call.
·         Execute DML statements using collections instead of individual records per DML statement.
·         Use Collections in SOQL "WHERE" clauses to retrieve all records back in single query
·         Use a consistent naming convention including the object name (e.g., AccountTrigger)

Force.com Best Practices - Triggers Force.com Best Practices - Triggers Reviewed by dasfrogpractice on 06:12 Rating: 5

No comments:

Theme images by mariusFM77. Powered by Blogger.
Youtube Channel Image
Dasfrog Subscribe To watch more Salesforce Training
Subscribe