Platform / Development (Apex, LWC & VF)
Flow Test Fails with Apex Error When Using Apex Test Data Source to Insert Service Appointment.
- Reported
- Nov 26, 2026
- Updated
- Nov 26, 2026
- Fixed
- —
- Reports
- 0
- Found in
- Winter '27
- Reference
- W-25038412
Summary
When the Apex test class (eg: TestFlowSAData), which inserts a Service Appointment and its related records, is executed independently, both the Work Order and Service Appointment records are created successfully.
However, when the same Apex class is executed through Flow Builder using the Run Data Silos functionality, the process fails with an Apex-related error.
Error: We couldn't create some objects because of an Apex error in your *Apex class*. Fix the error in the *apex class* class and try again.Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 950068541-47227 (-1641935342) (-1641935342)
Workaround
- Preferred: Do not use the Apex Test Data Source for ServiceAppointment. In Flow Builder, create a Flow Test and enter the triggering ServiceAppointment values manually in the test inputs. This avoids Apex execution and share creation, so the error cannot occur.
- Alternative: If the flow requires related records from the Apex data source, remove the ServiceAppointment insert from the Apex test class (e.g., delete the insert sa block) while keeping other related records (WorkOrder, Account, Contact, Asset, WorkType). Select the class as the data source, then manually enter ServiceAppointment field values on the selection screen. If the failure persists, fall back to the preferred option.
- Apex coverage path: Write a standard @IsTest method that inserts the ServiceAppointment and asserts flow outcomes. The defect affects only the Flow Test data-source UI path, not normal Apex tests.
These actions will allow continued validation without exposing the faulty RowCause handling.
Steps to reproduce
- Execute the Apex test class (eg:
TestFlowSAData) independently as a standard Apex test using the Developer Console. - Verify that the setup DML operations execute successfully and that the subsequent Work Order queries return the expected records.
- Navigate to Flow Builder and create or open the relevant Flow Test.
- Select the Apex Test Data Source class (eg:
TestFlowSAData), which inserts a Service Appointment and its related records. - Wait for the data silo field-selection screen to load.
- Observe that the process fails with the an error mentioned above.
Status timeline
Nov 30, 2026
created · In Review · 0 reports
Nov 30, 2026
content changed · In Review · 0 reports