Salesforce Platform Developer I (legacy) — Question 41
A company wants to create an employee rating program that allows employees to rate each other. An employee's average rating must be displayed on the employee record. Employees must be able to create rating records, but are not allowed to create employee records.
Which two actions should a developer take to accomplish this task? (Choose two.)
Answer options
- A. Create a trigger on the Rating object that updates a fields on the Employee object.
- B. Create a lookup relationship between the Rating and Employee object.
- C. Create a roll-up summary field on the Employee and use AVG to calculate the average rating score.
- D. Create a master-detail relationship between the Rating and Employee objects.
Correct answer: A, B
Explanation
Option A is correct because a trigger can be used to update the Employee record with the average rating whenever a new Rating record is created. Option B is also correct as a lookup relationship allows linking the Rating records to the respective Employee records. Option C is incorrect because a roll-up summary field cannot be used in a lookup relationship, and option D is not suitable since the requirement specifies a lookup relationship.