Newer Version Available

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

MaintenancePlan

Represents a preventive maintenance schedule for one or more assets.

Supported Calls

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

Special Access Rules

Field Service Lightning must be enabled.

Fields

Field Name Details
AccountId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The account associated with the maintenance plan.
ContactId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The contact associated with the maintenance plan.
Description
Type
textarea
Properties
Create, Nillable, Update
Description
A description of the maintenance plan.
EndDate
Type
date
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The last day the maintenance plan is valid.
Frequency
Type
int
Properties
Create, Filter, Group, Sort, Update
Description
(Required) Amount of time between work orders. The unit is specified in the FrequencyType field.
FrequencyType
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Restricted picklist, Sort, Update
Description
(Required) The unit of frequency. The picklist includes the following values:
  • Days
  • Weeks
  • Months
  • Years

For example, if you need a work order every month, enter 1 in Frequency and select Month for Frequency Type.

GenerationTimeframe
Type
int
Properties
Create, Filter, Group, Sort, Update
Description

(Required) How far in advance work orders are generated in each batch. The unit is specified in the GenerationTimeframeType field.

GenerationTimeframeType
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Restricted picklist, Sort, Update
Description
(Required) The generation timeframe unit. The picklist includes the following values:
  • Days
  • Weeks
  • Months
  • Years

For example, if you need work orders for six months, enter 6 and select Months.

LastReferencedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed a record related to this record.
LastViewedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed this record. If this value is null, this record might only have been referenced (LastReferencedDate) and not viewed.
LocationId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Where the service takes place.
MaintenancePlanNumber
Type
string
Properties
Autonumber, Defaulted on create, Filter, Sort
Description
(Read Only) An auto-assigned number that identifies the maintenance plan.
MaintenancePlanTitle
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
A name for the maintenance plan.
MaintenanceWindowEndDays
Type
int
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Days after the suggested service date on the work order that the service appointment can be scheduled.
MaintenanceWindowStartDays
Type
int
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Days before the suggested service date on the work order that the service appointment can be scheduled.
NextSuggestedMaintenanceDate
Type
date
Properties
Create, Filter, Group, Sort, Update
Description
The suggested date of service for the first work order (not the date the work order is created). Once the first batch is run, this field is automatically populated. You can use this field if you need there to be a delay before the first maintenance visit (for example, if monthly maintenance should begin one year after the purchase date).
OwnerId
Type
reference
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
The owner of the maintenance plan.
StartDate
Type
date
Properties
Create, Filter, Group, Sort, Update
Description
The first day the maintenance plan is valid.
WorkOrderGenerationStatus
Type
picklist
Properties
Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort
Description
(Read Only) Indicates whether the work order generation is in progress or complete.

You can’t run two batches at the same time. You must wait until the first one is complete.

Note

WorkTypeId
Type
reference
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
The work type associated with the maintenance plan.