Newer Version Available

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

WorkOrderLineItem

Represents a subtask on a work order, 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()

Special Access Rules

Work orders must be enabled in your organization.

Fields

Field Name Details
AssetId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The asset associated with the work order line item. The asset is not automatically inherited from the parent work order.
Description
Type
textarea
Properties
Create, Nillable, Update
Description
The description of the work order line item. Try to describe the steps needed to mark the line item as Completed.
Discount
Type
percent
Properties
Create, Filter, Nillable, Sort, Update
Description
The percent discount to apply to the line item. You can enter a number with or without the percent symbol, and you can use up to two decimal places.
EndDate
Type
dateTime
Properties
Create, Filter, Nillable, Sort, Update
Description
The date on which the line item 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.
LineItemNumber
Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
An auto-generated number that identifies the work order line item. Each work order’s line items start at 1.
ListPrice
Type
currency
Properties
Filter, Nillable, Sort
Description

The price of the line item (product) as listed in its corresponding price book entry. If a price book entry isn’t specified, the list price defaults to zero.

OrderId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The order associated with the line item. For example, you may need to order replacement parts before you can complete the line item.
ParentWorkOrderLineItemId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The line item’s parent work order line item, if it has one.

Create a custom report to view a line item’s child line items.

Tip

PricebookEntryId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort
Description
The price book entry that corresponds with the line item. When you add an entry to this field, it adds the list price to the line item. A price book must be specified on the parent work order.
Product2Id
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The product associated with the price book entry.
Quantity
Type
double
Properties
Create, Filter, Nillable, Sort, Update
Description

Number of units of the line item included in the associated work order.

StartDate
Type
dateTime
Properties
Create, Filter, Nillable, Sort, Update
Description
The date on which the line item 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.
Status
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Nillable, Sort, Update
Description
The status of the line item. The picklist includes the following values, which can be customized:
  • New
  • In Progress
  • Completed
  • Closed
Subtotal
Type
currency
Properties
Filter, Nillable, Sort
Description

Read only. The line item’s unit price multiplied by the quantity.

TotalPrice
Type
currency
Properties
Filter, Nillable, Sort
Description
Read only. The line item’s subtotal with discounts applied.
UnitPrice
Type
currency
Properties
Create, Filter, Nillable, Sort, Update
Description
Initially, the unit price for a work order line item is the line item’s list price from the price book, but you can change it.
WorkOrderId
Type
reference
Properties
Create, Filter, Group, Sort
Description
The line item’s parent work order. Because work order line items must be associated with a work order, this is a required field.

Usage

A work order line item is a child record of a work order. It represents a specific subtask on a work order.

For example, suppose a customer purchased a truck from you. The truck is represented as an asset in your Salesforce org. After some time, the truck needs both headlight bulbs replaced. Here’s one way that you can use work orders and work order line items to track the repair.
  1. Create a work order named “Replace Headlight Bulbs” from the asset record detail page.
  2. Add three work order line items to the work order: “Replace Left Headlight Bulb,” “Replace Right Headlight Bulb,” and “Test Headlights.”
  3. Assign the work order to a technician via a queue.
  4. As the technician completes each line item, he or she marks the item as Completed.
  5. When all the line items are complete, the technician marks the work order as Completed.