Salesforce Certified Advanced Administrator — Question 36
The Marketing Manager has requested that a field be added to each account that displays the number of contacts associated with the account. The manager wants to use this field as part of an email marketing segmentation strategy.
How can this requirement be met?
Answer options
- A. Create a roll-up summary field that counts the number of contacts and displays the count on the account
- B. Create a custom formula field on the account using the count() function to count the number of related contacts
- C. Create a custom field on the account. Use an Apex trigger to update the field when contacts are added or deleted
- D. Create a custom field on the account. Use a workflow rule to update the field when contacts are added or deleted
Correct answer: C
Explanation
Option C is correct because using an Apex trigger allows for dynamic updates to the custom field whenever contacts are added or deleted, ensuring accurate counts. Options A and B are incorrect since they do not provide real-time updates like an Apex trigger does. Option D is also not suitable because workflow rules do not allow for such dynamic updates and are less efficient compared to an Apex trigger.