What is a good practice for a developer to follow when writing a - ProProfs Discuss
Topics
Products
Follow Us:

What is a good practice for a developer to follow when writing a trigger?



A. Using @future methods to perform DML operations.
B. Using the Map data structure to hold query results by ID.
C. Using the Set data structure to ensure distinct records.
D. Using synchronous callouts to call external systems.

This question is part of Salesforce Platform Developer 1
Asked by Wyatt Williams, Last updated: Jan 11, 2020

+ Answer
Request

2 Answers

L. Sevigny

L. Sevigny, Doctor, Las Vegas

Answered Sep 14, 2018

Good practice for developers writing trigger includes quite a long list of considerations. Here are some: Don't use multiple triggers for a single object; this will confuse things and you'll lose control of the execution. Your trigger handlers should have context specific handlers. When you write code, bulkify it, so that a code can handle more than one record at a time. Use Apex collections for querying and storing data. There should only be one trigger for each object. Avoid comple...Read More
 

Wyatt Williams

Wyatt Williams

Answered Jan 15, 2018

Using the Map data structure to hold query results by ID.
Using the Set data structure to ensure distinct records.

####
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.