Newer Version Available

This content describes an older version of this product. View Latest

WorkOrder

Represents a task or series of tasks to be performed, typically in field service. This object is available in API version 36.0 and later.

Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), undelete(), update(), upsert()

Fields

Field Name Details
AccountId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The account associated with the work order.
Address
Type
address
Properties
Filter, Nillable
Description
The compound form of the address where the work order is completed.
AssetId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The asset associated with the work order.
BusinessHoursId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The business hours associated with the work order.
CaseId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The case associated with the work order.
City
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The city where the work order is completed. Maximum length is 40 characters.
ContactId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The contact associated with the work order.
Country
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The country where the work order is completed. Maximum length is 80 characters.
CurrencyIsoCode
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
Available only for orgs with the multicurrency feature enabled. Contains the ISO code for any currency allowed by the organization. The label in the user interface is Currency ISO Code.
Description
Type
textarea
Properties
Create, Nillable, Update
Description
The description of the work order. Try to include the steps needed to change the work order’s status to Completed.
Discount
Type
percent
Properties
Filter, Nillable, Sort
Description
Read only. The weighted average of the discounts on all line items in the work order. It can be any positive number up to 100.
Duration
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
The estimated time required to complete the work order. Specify the duration unit in the Duration Type field.

Work order duration and work order line item duration are independent of each other. If you want work order duration to automatically show the sum of the work order line items’ duration, replace the Duration field on work orders with a custom roll-up summary field.

Note

DurationType
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
The unit of the duration: Minutes or Hours.
EndDate
Type
dateTime
Properties
Create, Filter, Nillable, Sort, Update
Description
The date when the work order is completed. This field is blank unless you set up an Apex trigger or quick action to populate it. For example, you can create a quick action that sets the EndDate to 365 days after the StartDate.
EntitlementId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The entitlement associated with the work order.
GeocodeAccuracy
Type
picklist
Properties
Create, Filter, Group, Nillable, Restricted picklist, Sort, Update
Description
Accuracy level of the geocode for the address. See Compound Field Considerations and Limitations for details on geolocation compound fields.

This field is available in the API only.

Note

GrandTotal
Type
currency
Properties
Filter, Nillable, Sort
Description
Read only. The total price of the work order with tax added.
IsClosed
Type
boolean
Properties
Group, Defaulted on create, Filter, Sort
Description
Indicates whether the work order is closed (true) or open (false).

Use this field to report on closed versus open work orders.

Tip

IsStopped
Type
boolean
Properties
Group, Defaulted on create, Create, Filter, Sort, Update
Description
Indicates whether a milestone is paused (true) or counting down (false). This field is available only if Enable stopped time and actual elapsed time is selected on the Entitlement Settings page.
LastReferencedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The date when the work order was last modified. Its label in the user interface is Last Modified Date.
LastViewedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The date when the work order was last viewed.
Latitude
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
Used with Longitude to specify the precise geolocation of the address where the work order is completed. Acceptable values are numbers between –90 and 90 with up to 15 decimal places. See Compound Field Considerations and Limitations for details on geolocation compound fields.

This field is available in the API only.

Note

LineItemCount
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The number of work order line items in the work order. Its label in the user interface is Line Items.
Longitude
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description
Used with Latitude to specify the precise geolocation of the address where the work order is completed. Acceptable values are numbers between –180 and 180 with up to 15 decimal places. See Compound Field Considerations and Limitations for details on geolocation compound fields.

This field is available in the API only.

Note

MaintenancePlanId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The maintenance plan associated with the work order. When the work order is auto-generated from a maintenance plan, this field automatically lists the related plan.
MilestoneStatus
Type
string
Properties
Group, Nillable, Sort
Description
Indicates the status of a milestone. This field is visible if an entitlement process is applied to a work order.
MinimumCrewSize
Type
int
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The minimum crew size allowed for a crew assigned to the work order.

If you’re not using the Field Service Lightning managed package, this field serves as a suggestion rather than a rule. If you are using the managed package, the scheduling optimizer counts the number of service crew members on a service crew to determine whether it fits a work order’s minimum crew size requirement.

OwnerId
Type
reference
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
The work order’s assigned owner.
ParentWorkOrderId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The work order’s parent work order, if it has one.

Create a custom report to view a work order’s child work orders.

Tip

PostalCode
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The postal code where the work order is completed. Maximum length is 20 characters.
Pricebook2Id
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The price book associated with the work order. Adding a price book to the work order lets you assign different price book entries to the work order’s line items. This is only available if Product2 is enabled.
Priority
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Sort, Update
Description
The priority of the work order. The picklist includes the following values, which can be customized:
  • Low
  • Medium
  • High
  • Critical
RecommendedCrewSize
Type
int
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The recommended number of people on the service crew assigned to the work order. For example, you might have a Minimum Crew Size of 2 and a Recommended Crew Size of 3.
RootWorkOrderId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
(Read only) The top-level work order in a work order hierarchy. Depending on where a work order lies in the hierarchy, its root could be the same as its parent.

View a work order’s child work order in the Child Work Orders related list.

Note

ServiceAppointmentCount
Type
int
Properties
Filter, Group, Nillable, Sort
Description
The number of service appointments on the work order.
ServiceContractId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The service contract associated with the work order.
ServiceReportTemplateId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The service report template that the work order uses. If you don’t specify a service report template on a work order, it uses the service report template listed on its work type. If the work type doesn’t list a template or no work type is specified, the work order uses the default service report template.
ServiceTerritoryId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The service territory where the work order is taking place.
SlaExitDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The time that the work order exits the entitlement process.
SlaStartDate
Type
dateTime
Properties
Create, Filter, Nillable, Update, Sort
Description
The time that the work order enters the entitlement process. You can update or reset the time if you have “Edit” permission on work orders.
StartDate
Type
dateTime
Properties
Create, Filter, Nillable, Sort, Update
Description
The date when the work order goes into effect. This field is blank unless you set up an Apex trigger or quick action to populate it. For example, you can create a quick action that sets the StartDate to the date when the Status changes to In Progress.
State
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The state where the work order is completed. Maximum length is 80 characters.
Status
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Sort, Update
Description
The status of the work order. The picklist includes the following values, which can be customized:
  • New—Work order was created, but there hasn’t yet been any activity.
  • In Progress—Work has begun.
  • On Hold—Work is paused.
  • Completed—Work is complete.
  • Cannot Complete—Work could not be completed.
  • Closed—All work and associated activity is complete.
  • Canceled—Work is canceled, typically before any work began.
Changing a work order’s status does not affect the status of its work order line items or associated service appointments.
StatusCategory
Type
picklist
Properties
Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort
Description
The category that each Status value falls into. The Status Category field has eight default values: seven values which are identical to the default Status values, and a None value for statuses without a status category.

If you create custom Status values, you must indicate which category it belongs to. For example, if you create a Waiting for Response value, you may decide that it belongs in the On Hold category.

The Status Category field can be useful to reference in custom apps, triggers, and validation rules. Status categories let you extend and customize the work life cycle while still maintaining a consistent work classification for tracking, reporting, and business process management.

StopStartDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Indicates when the milestone was paused. The label in the user interface is Stopped Since.
Street
Type
textarea
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The street number and name where the work order is completed.
Subject
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The subject of the work order. Try to describe the nature and purpose of the job to be completed. For example, “Annual On-Site Well Maintenance.” Maximum length is 255 characters.
Subtotal
Type
currency
Properties
Filter, Nillable, Sort
Description
Read only. The total of the work order line items’ subtotals before discounts and taxes are applied.
SuggestedMaintenanceDate
Type
date
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The suggested date that the work order is completed. When the work order is auto-generated from a maintenance plan, this field is automatically populated based on the maintenance plan’s settings.
Tax
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
The total tax on the work order. You can enter a number with or without the currency symbol and use up to two decimal places. For example, in a work order whose total price is $100, enter $10 to apply a 10% tax.
TotalPrice
Type
currency
Properties
Filter, Nillable, Sort
Description
Read only. The total of the work order line items’ prices. This value has discounts applied but not tax.
WorkOrderNumber
Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
An eight-digit, auto-generated number that identifies the work order.
WorkTypeId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The work type associated with the work order. When a work type is selected, the work order automatically inherits the work type’s Duration, Duration Type, and required skills.

Usage

A work order can be a child record of accounts, assets, cases, contacts, entitlements, service contracts, and other work orders. We recommend adding work order line items to the work order to break the main task into smaller subtasks.