Field Service Code Examples
Use these code examples to get started working programmatically with Field Service features.
-
Create a Service Report with Apex
The Create Service Report action on work orders, work order line items, and service appointments can also be called using Apex code. The code example shown creates a service report with two signatures by making an Apex callout to the createServiceReport action REST API resource.
-
Generate Work Orders on Maintenance Plans with Apex
The Generate Work Orders action on maintenance plans can also be called using Apex code. The following code sample creates work order records by making an Apex callout to the generateWorkOrder action REST API resource.
-
Code Examples: Dispatcher Console Custom Actions
Learn how to configure Apex classes or Visualforce pages that you want to link to a custom action in the dispatcher console.
-
Create Service Appointment Lists in the Dispatcher Console
You can create user-specific temporary appointment lists by adding the Create Temporary Service Appointment List custom permission in Field Service managed package. If the custom permission is enabled, the Field Service app creates a connection to the CreateFilterEvent__e platform event channel and subscribes to related messages.