Learn the most efficient way to keep the TotalJobs_c field on Account up to date in Salesforce CRT-450 Exam. Discover the best approach using roll-up summary fields.
Table of Contents
Question
Ursa Major Solar has a custom object, ServiceJob_c, with an optional Lookup field to Account called Partner_Service_Provider_c.
The TotalJobs_c field on Account tracks the total number of ServiceJob_c records to which a partner service provider Account is related.
What is the most efficient way to ensure that the TotalJobs_c field is kept up to date?
A. Create an Apex trigger on ServiceJob_c.
B. Change TotalJobs_c to a roll-up summary field.
C. Create a record-triggered flow on ServiceJob_c.
D. Create a schedule-triggered flow on ServiceJob_c.
Answer
B. Change TotalJobs_c to a roll-up summary field.
Explanation
The most efficient way to ensure that the TotalJobs_c field on Account is kept up to date is: B. Change TotalJobs_c to a roll-up summary field.
Roll-up summary fields automatically calculate and store the sum, minimum, maximum, or count of related records. By changing TotalJobs_c to a roll-up summary field, it will automatically count the number of related ServiceJob_c records and update the value whenever a ServiceJob_c record is created, updated, or deleted.
This approach is more efficient than using Apex triggers or flows because:
- It leverages Salesforce’s built-in functionality, reducing custom code and maintenance.
- Roll-up summary fields are calculated in real-time, ensuring accurate data.
- It eliminates the need for additional automation, simplifying the solution.
Therefore, converting TotalJobs_c to a roll-up summary field is the most efficient and reliable way to keep the field up to date based on the related ServiceJob_c records.
Salesforce Certified Platform Developer I CRT-450 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Salesforce Certified Platform Developer I CRT-450 exam and earn Salesforce Certified Platform Developer I CRT-450 certification.