Salesforce Certified Platform App Builder — Question 107

A user has requested a field that counts the number of child records associated with a custom object. These custom objects have a lookup relationship between each other.
Which feature would best accomplish this requirement?

Answer options

Correct answer: A

Explanation

The correct answer is A, Apex Trigger, as it allows for custom logic that can count child records based on the relationships defined. A Roll-Up Summary Field is not applicable here since it only works with master-detail relationships, while Lightning Process Builder and Visual Flow do not provide the necessary logic for counting child records directly.