Newer Version Available
OpportunityLineItemSchedule
Supported Calls
create(), delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), update(), upsert()
Fields
| Field | Details |
|---|---|
| CurrencyIsoCode |
|
| Description |
|
| IsDeleted |
|
| OpportunityLineItemId |
|
| Quantity |
|
| Revenue |
|
| ScheduleDate |
|
| Type |
|
Allowed Type Field Values
- The Product2 on which the OpportunityLineItem is based must have the appropriate CanUseRevenueSchedule or CanUseQuantitySchedule fields (or both) set to true.
- When you create a schedule for a line item that does not have any existing schedules, you can specify any valid value.
- If you create a schedule for a line item that already has existing schedules, the new schedule must be consistent with the existing schedules. The following matrix outlines the allowable values:
| Value of HasRevenueSchedule on line item | Value of HasQuantitySchedule on line item | Allowable Type Values |
|---|---|---|
| false | false | Revenue, Quantity, both |
| false | true | Quantity |
| true | false | Revenue |
| true | true | both |
Allowed Quantity and Revenue Field Values
The allowable Quantity and Revenue field values depend on the value of the Type field:
| Type Value | Allowable Quantity Value | Allowable Revenue Value |
|---|---|---|
| Revenue | Null | Non-null |
| Quantity | Non-null | Null |
| both | Non-null | Non-null |
- For a schedule of Type Quantity, you can’t update a null Revenue value to non-null. Likewise for a schedule of Type Revenue, you can’t update a null Quantity value to non-null.
- You can’t null out the Quantity field for a schedule of Type Quantity. Likewise you can’t null out the Revenue field for a schedule of Type Revenue.
- You can’t null out either the Revenue or Quantity fields for a schedule of type Both.
Usage
OpportunityLineItemSchedule supports two types of schedules:
- Quantity schedules
- Revenue schedules
The user must have edit access rights on the Opportunity in order to create or update line item schedules on that opportunity.
Products and Schedules Must Be Enabled
The OpportunityLineItemSchedule object is defined only for those organizations that have the products and schedules features enabled. If the organization does not have the products and schedules features, the OpportunityLineItemSchedule object is not returned in a describe, and you can't describe or query OpportunityLineItemSchedule records.
Effects on Opportunities and Opportunity Line Items
- Inserting an OpportunityLineItemSchedule of Type “Revenue” or “Quantity” increments the TotalPrice field on the OpportunityLineItem by the OpportunityLineItemSchedule Revenue amount. Inserting an OpportunityLineItemSchedule of Type Quantity or Both increments the Quantity field on the OpportunityLineItem by the OpportunityLineItemSchedule Quantity amount.
- Creating an OpportunityLineItemSchedule record affects the original
opportunity:
- The Opportunity Amount is incremented the by OpportunityLineItemSchedule revenue amount
- The Opportunity ExpectedRevenue is incremented by the line item schedule amount multiplied by the Opportunity Probability
- Deleting an OpportunityLineItemSchedule has a similar effect on the related OpportunityLineItem and Opportunity. Deleting an OpportunityLineItemSchedule decrements the OpportunityLineItem TotalPrice by the deleted OpportunityLineItemSchedule Quantity or Revenue amount. The Opportunity Amount is also decremented by the OpportunityLineItemSchedule Quantity or Revenue amount, and the Opportunity ExpectedRevenue is reduced by OpportunityLineItemSchedule Quantity or Revenue amount multiplied by the Opportunity Probability.
Deleting an Opportunity Line Item Schedule
Deleting the last remaining schedule will set the corresponding HasQuantitySchedule or HasRevenueSchedule flags (or both) to false on the parent line item.