Product2

Represents a product that your organization sells.

This object has several fields that are used only for quantity and revenue schedules (for example, annuities). Schedules are available only for organizations that have enabled the products and schedules features. If these features aren’t enabled, the schedule fields don’t appear in the DescribeSObjectResult, and you can’t query, create, or update the fields.

Note
Products are represented by Product2 objects. The Product object is no longer available.

Supported Calls

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

Fields

Field Details
CanUseQuantitySchedule
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether the product can have a quantity schedule (true) or not (false). Label is Quantity Scheduling Enabled.
CanUseRevenueSchedule
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Indicates whether the product can have a revenue schedule (true) or not (false). Label is Revenue Scheduling Enabled.
ConnectionReceivedId
Type
reference
Properties
Filter, Nillable
Description
ID of the PartnerNetworkConnection that shared this record with your organization. This field is only available if you have enabled Salesforce to Salesforce.
ConnectionSentId
Type
reference
Properties
Filter, Nillable
Description
ID of the PartnerNetworkConnection that you shared this record with. This field is only available if you have enabled Salesforce to Salesforce. Beginning with API version 15.0, the ConnectionSentId field is no longer supported. The ConnectionSentId field is still visible, but the value is null. You can use the new PartnerNetworkRecordConnection object to forward records to connections.
CurrencyIsoCode
Type
picklist
Properties
Filter, Restricted picklist
Description
Available only for organizations with the multicurrency feature enabled. Contains the ISO code for any currency allowed by the organization.
DefaultPrice
Type
currency
Properties
Create, Filter, Update
Description
The default price for this record.
Description
Type
textarea
Properties
Create, Filter, Nillable, Sort, Update
Description
A text description of this record. Label is Product Description.
Family
Type
picklist
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Name of the product family associated with this record. Product families are configured as picklists in the user interface. To obtain a list of valid values, call describeSObjects() and process the DescribeSObjectResult for the values associated with the Family field. Label is Product Family.
IsActive
Type
boolean
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
Indicates whether this record is active (true) or not (false). Inactive Product2 records are hidden in many areas in the user interface. You can change the IsActive flag on a Product2 object as often as necessary. Label is Active.
IsDeleted
Type
boolean
Properties
Defaulted on create, Filter
Description
Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted.
Name
Type
string
Properties
Create, Filter, Group, Sort, Update
Description
Required. Default name of this record. Label is Product Name.
NumberOfQuantityInstallments
Type
int
Properties
Filter, Group, Sort
Description
If the product has a quantity schedule, the number of installments.
NumberOfRevenueInstallments
Type
int
Properties
Filter, Group, Nillable, Sort
Description
If the product has a revenue schedule, the number of installments.
ProductCode
Type
string
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Default product code for this record. The product code naming pattern is defined by your organization.
QuantityInstallmentPeriod
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
If the product has a quantity schedule, the amount of time covered by the schedule.
QuantityScheduleType
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The type of the quantity schedule, if the product has one.
RecalculateTotalPrice
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Changes behavior of OpportunityLineItem calculations when a line item has child schedule rows for the Quantity value. When enabled, if the rollup quantity changes, then the quantity rollup value is multiplied against the sales price to change the total price.
RevenueInstallmentPeriod
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
If the product has a revenue schedule, the period of time covered by the schedule.
RevenueScheduleType
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The type of the revenue schedule, if the product has one.

Schedule Enabled Flags

When enabling the schedules feature, organizations can decide whether to enable quantity schedules, revenue schedules, or both. In addition, you can use the API to control quantity and revenue scheduling at the product level via the CanUseQuantitySchedule and CanUseRevenueSchedule flags. A value of true for either flag indicates that the product and any OpportunityLineItems can have a schedule of that type. These flags can be set when creating or updating Product2 records.

Default Schedule Fields

The remaining schedule fields for this object define default schedules. Default schedule values are used to create an OpportunityLineItemSchedule when an OpportunityLineItem is created for the Product.

The default schedule fields support the following valid values (all fields are also nillable).

Field Valid Values
RevenueScheduleType Divide, Repeat
RevenueInstallmentPeriod Daily, Weekly, Monthly, Quarterly, Yearly
NumberOfRevenueInstallments Integer between 1 to 150, inclusive.
QuantityScheduleType Divide, Repeat
QuantityInstallmentPeriod Daily, Weekly, Monthly, Quarterly, Yearly
NumberOfQuantityInstallments Integer between 1 to 150, inclusive

When you attempt to set the schedule fields when creating or updating, the API applies cross-field integrity checks. The integrity requirements are:

Any create or update that fails these integrity checks is rejected with an error.

These default schedule fields, as well as CanUseQuantitySchedule and CanUseRevenueSchedule, are restricted picklist fields and are available only if the organization has the schedules feature enabled.

Usage

Use this object to define the default product information for your organization. This object is associated by reference with Pricebook2 objects via PricebookEntry objects. The same product can be represented in different price books as price book entries. In fact, the same product can be represented multiple times (as separate PricebookEntry records) in the same price book with different prices or currencies. A product can only have one price for a given currency within the same price book. To be used in custom price books, all standard prices must be added as price book entries to the standard price book.

You can query the products that have been configured for your organization. For example, you can allow your client application to obtain valid product IDs for use when configuring PricebookEntry records via the API. Your client application can perform the following tasks on PricebookEntry objects:
  • Query
  • Create for the standard pricebook or custom pricebooks.
  • Update
  • Delete
  • Change the IsActive field when creating or updating records

This object is defined only for those organizations that have products enabled as a feature. If the organization does not have the products feature, this object does not appear in the describeGlobal() call, and you can’t describe or query this object.

If you try to delete a product via the API but there is an opportunity that uses that product, the delete fails. The workaround is to delete the product in the user interface, which gives you an option to archive the product.

Note
On opportunities and opportunity products, the workflow rules, validation rules, and Apex triggers fire when an update to a child opportunity product or schedule causes an update to the parent record. This means your custom application logic is enforced when there are updates to the parent record, ensuring higher data quality and compliance with your organization’s business policies.
© Copyright 2000–2014 salesforce.com, inc. All rights reserved.
Various trademarks held by their respective owners.