Loading

How to prevent deletion of Assigned Resource records in Field Service

Publiceringsdatum: Jun 12, 2026
Beskrivning

Problem

In-Field Service, users can delete Assigned Resource records even when the parent Service Appointment is in a completed state. Salesforce doesn't provide a supported method to remove or disable the standard Delete action globally across all profiles at the object level. Deleting an Assigned Resource from a completed appointment can unintentionally reopen the appointment, creating a data integrity risk and bypassing service lifecycle controls.

 

Cause

The Delete action on the Assigned Resource object is a standard platform action. Page layout customization, permission sets, and profile settings do not control the availability of standard Delete actions at the object level. When an Assigned Resource is deleted, the related Service Appointment's status can be modified, which may allow completed appointments to be reopened without a business rule to prevent it.

Lösning
Resolution

Because the Delete action cannot be removed at the platform level, create a before-delete Record-Triggered Flow on the Assigned Resource object to enforce the restriction at the database level.

  1. In Setup, navigate to Flows and click New Flow.
  2. Select Record-Triggered Flow and choose Assigned Resource as the object.
  3. Set the trigger to Before Delete.
  4. Add a Get Records element to retrieve the related Service Appointment using the ServiceAppointmentId field on the Assigned Resource record.
  5. Add a Decision element to check whether the Service Appointment's status equals Completed.
  6. If the condition is true, add a Custom Error element to block the deletion and display the message: "Assigned Resources cannot be deleted from completed Service Appointments."
  7. If the condition is false, allow the flow to end without blocking the deletion.
  8. Click Save, name the flow (e.g., Prevent Assigned Resource Deletion on Completed Appointments), and click Activate.


NOTE: The Delete button remains visible in the Assigned Resource related list and list view. The Flow blocks deletion at the database level but does not hide the button from the UI. To hide the button entirely, a custom Lightning Web Component replacing the standard related list would be required — this is not a standard platform feature and requires additional development.
Knowledge-artikelnummer

005386900

 
Laddar
Salesforce Help | Article