nerdexam
Salesforce

PDI · Question #98

Ursa Major Solar has a custom object, serviceJob-o, with an optional Lookup field to Account called partner-service-Provider_c. The TotalJobs-o field on Account tracks the total number of…

The correct answer is B. Create a record-triggered flow on ServiceJob_o. The task is to efficiently keep a count field on an Account updated based on the number of related serviceJob__c records, where the relationship is an optional lookup.

Submitted by diego_uy· Apr 18, 2026Logic and Process Automation

Question

Ursa Major Solar has a custom object, serviceJob-o, with an optional Lookup field to Account called partner-service-Provider_c. The TotalJobs-o field on Account tracks the total number of serviceJob-o records to which a partner service provider Account is related. What is the most efficient way to ensure that the Total job_o field kept up to data?

Options

  • AChange TotalJob_o to a roll-up summary field.
  • BCreate a record-triggered flow on ServiceJob_o.
  • CCreate an Apex trigger on ServiceJob_o.
  • DCreate a schedule-triggered flow on ServiceJob_o.

How the community answered

(49 responses)
  • A
    12% (6)
  • B
    80% (39)
  • C
    2% (1)
  • D
    6% (3)

Why each option

The task is to efficiently keep a count field on an Account updated based on the number of related `serviceJob__c` records, where the relationship is an optional lookup.

AChange TotalJob_o to a roll-up summary field.

A roll-up summary field requires a master-detail relationship to directly aggregate data, which is not possible with an optional lookup field like `partner_service_Provider__c`.

BCreate a record-triggered flow on ServiceJob_o.Correct

A record-triggered flow on the `ServiceJob__c` object is the most efficient declarative solution. It can execute when a `ServiceJob__c` record is created, updated, or deleted to query and update the `TotalJobs__c` field on the related Account, handling the optional lookup relationship dynamically.

CCreate an Apex trigger on ServiceJob_o.

An Apex trigger could accomplish this, but a record-triggered flow is generally more efficient for this type of problem as it is a declarative solution, reducing development and maintenance overhead.

DCreate a schedule-triggered flow on ServiceJob_o.

A schedule-triggered flow runs at predefined intervals, which would lead to delayed updates for the `TotalJobs__c` field, making it inefficient for real-time data synchronization.

Concept tested: Record-triggered flow for count aggregation on lookup relationships

Source: https://help.salesforce.com/s/articleView?id=sf.flow_builder.htm&type=5

Topics

#Record-triggered Flow#Lookup Relationships#Cross-Object Updates#Declarative Automation

Community Discussion

No community discussion yet for this question.

Full PDI Practice