Loading

Auto-Schedule checkbox fails with 'Database.executeBatch cannot be called from a future method' when SA created without address in After Insert trigger

Publish Date: May 12, 2026
Description
The auto-scheduling fails when the auto-schedule checkbox is set to true in the after insert trigger, and the Service Appointment record does not have an address set. Service Appointments with an address are auto-scheduled successfully.
Resolution

1. Ensure that the Service Appointment is created in one transaction first.

2. Trigger the auto-schedule checkbox or logic invoking the auto-schedule batch in a separate, synchronous transaction.

Knowledge Article Number

005319415

 
Loading
Salesforce Help | Article