---
schema_version: "1"
id: 0f511c4e4a2e99e4f7896b8286e5e86566cadfc5cb8abbbdd167b40206c079ef
title: WorkPlanSelectionRule
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_workplanselectionrule.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_workplanselectionrule.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: a05e3f6708bb4c07ee35272371bf95bc87bd0031bcae0bbd60601415cd6c2cd3
description: Represents a rule that selects a work plan for a work order or work order line item. This object is available in API version 52.0 and later.
---
# WorkPlanSelectionRule

Represents a rule that selects a work plan for a work order or work order line item. This object is available in API version 52.0 and later.

## Supported Calls

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

## Special Access Rules

Field Service must be enabled.

## Fields

| Field | Details |
| --- | --- |
| AssetId | 
Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ID of the asset.



 |
| Description | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The description of the selection rule.



 |
| IsActive | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

Controls whether this selection rule is active (true) or not (false). Default is false. Label is Active.



 |
| LastReferencedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The timestamp when the current user last interacted with this record, directly or indirectly.



 |
| LastViewedDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The timestamp when the current user last viewed this record or list view. If this value is null, it's possible that the user only accessed this record or list view (LastReferencedDate), but not viewed it.



 |
| LocationId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ID of the location.



 |
| OwnerId | 

Type

reference

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

The ID of the owner.



 |
| Product2Id | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ID of the product. Label is Product.



 |
| ServiceTerritoryId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ID of the service territory.



 |
| WorkPlanSelectionRuleNumber | 

Type

string

Properties

Autonumber, Defaulted on create, Filter, idLookup, Sort

Description

The auto-generated number of the work plan selection rule, for example, WPSR-0001.



 |
| WorkPlanTemplateId | 

Type

reference

Properties

Create, Filter, Group, Sort, Update

Description

Required. The ID of the work plan template.



 |
| WorkTypeId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ID of the work type.



 |

## Associated Objects

This object has these associated objects. Unless noted, they’re available in the same API version as this object.

[WorkPlanSelectionRuleChangeEvent](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_change_event.htm "A ChangeEvent object is available for each object that supports Change Data Capture. You can subscribe to a stream of change events using Change Data Capture to receive data tied to record changes in Salesforce. Changes include record creation, updates to an existing record, deletion of a record, and undeletion of a record. A change event isn’t a Salesforce object—it doesn’t support CRUD operations or queries. It’s included in the object reference so you can discover which Salesforce objects support change events.")

Change events are available for the object.

[WorkPlanSelectionRuleFeed](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_feed.htm "StandardObjectNameFeed is the model for all feed objects associated with standard objects. These objects represent the posts and feed-tracked changes of a standard object.")

Feed tracking is available for the object.

[WorkPlanSelectionRuleHistory](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_history.htm "StandardObjectNameHistory is the model for all history objects associated with standard objects. These objects represent the history of changes to the values in the fields of a standard object.")

History is available for tracked fields of the object.

[WorkPlanSelectionRuleOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_ownersharingrule.htm "StandardObjectNameOwnerSharingRule is the model for all owner sharing rule objects associated with standard objects. These objects represent a rule for sharing a standard object with users other than the owner.")

Sharing rules are available for the object.

[WorkPlanSelectionRuleShare](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_share.htm "StandardObjectNameShare is the model for all share objects associated with standard objects. These objects represent a sharing entry on the standard object.")

Sharing is available for the object.