Loading
Upcoming Mandatory Changes to Public Key Infrastructure (PKI)Read More
Salesforce Enforces New Security Requirements in Summer 2026Read More

Duplicate Assigned Resource Records Created on Service Appointment During Concurrent Scheduling

Publish Date: Jun 12, 2026
Description

Duplicate AssignedResource records get created for a single ServiceAppointment when two users — a Dispatcher and an Integration User — simultaneously schedule the same Service Appointment.

Root Cause / Expected Behavior:
This is expected platform behavior. Since both operations begin before either has completed, neither operation is aware of the other's in-progress assignment. Both independently generate a new AssignedResource record on the same Service Appointment, resulting in two separate AR records.

Resolution
Option A — Validation Rule (Declarative)
  1. Create a Checkbox Formula Field on AssignedResource: Is_Technician__c = ServiceResource.ResourceType = "T"
  2. Create a Roll-Up Summary on ServiceAppointment counting ARs where Is_Technician__c = True
  3. Add a Validation Rule on AssignedResource to block save when count ≥ 1

Option B — Apex Trigger (Programmatic)
Use a before insert trigger on AssignedResource that queries existing AR records for the same SA and throws an error if a Technician is already assigned.
Knowledge Article Number

005386857

 
Loading
Salesforce Help | Article