Salesforce Certified Platform Developer II — Question 66

An org contains two custom objects: Building__c and Office__c. Office__c has a Lookup field to Building__c.
A developer is asked to automatically populate the Number_of_Offices__c field on the Building__c object with the count of related Office__c records anytime an
Office__c record is created or deleted. The developer cannot modify the field types.
Which solutionmeets the requirements?

Answer options

Correct answer: B

Explanation

The correct answer is B, Workflow, which can automatically update fields based on certain criteria when a record is created or deleted. Although Flow, Apex Trigger, and Process Builder could also potentially meet the requirements, they may be more complex or not as straightforward for the specific task of counting related records in this context.