Newer Version Available

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

PriceAdjustmentSchedule

Represents a series of discounts offered depending on your product's configuration, quantity, and when they’re purchased in combination with other products. This object is available in API version 47.0 and later.

Supported Calls

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

Special Access Rules

This object is available when the B2B Commerce license is enabled or when Subscription Management is enabled.

Fields

Field Details
AdjustmentMethod
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Restricted picklist, Sort, Update
Description
The method for applying tiered pricing. Possible values are:
  • Range—All items receive the discount of the highest tier the quantity falls in.
  • Slab—Items receive the discount defined for the tier they fall in.
The default value is Range. Term-based discounts can’t be of type Slab. This field is available in API version 51.0 and later.

The Slab method functions in the same way as the Range method.

Description
Type
textarea
Properties
Create, Filter, Group, Nillable, Sort, Update
Description
Text description of the price adjustment schedule.
IsActive
Type
boolean
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
Indicates whether the price adjustment schedule is active (true) or not (false). You can change this field’s value as often as necessary. Label is Active. The default value is False.
LastReferencedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
Indicates whether the price adjustment schedule has been archived (true) or not (false). This field is read-only.
LastViewedDate
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The timestamp for when the current user last viewed this record. If this value is null, it’s possible that this record was referenced (LastReferencedDate) and not viewed.
Name
Type
string
Properties
Create, Filter, Group, idLookup, Sort, Update
Description
Required. The name of the price adjustment schedule. This field is read-only. Label is Price Adjustment Schedule Name.
OwnerId
Type
reference
Properties
Create, Defaulted on create, Filter, Group, Sort, Update
Description
The Salesforce ID of the sales representative who owns the price adjustment schedule.
ScheduleType
Type
picklist
Properties
Create, Defaulted on create, Filter, Group, Restricted picklist, Sort, Update
Description
Indicates how the price adjustment is determined. This field is available when Subscription Management is enabled. This field is available in API version 55.0 and later.
Possible values are:
  • Attribute—The characteristics or properties of a product determine the price adjustment.
  • Bundle—The price adjustment that is determined when you want to sell a group of products or services as a unit.
  • Custom—The price adjustment that can be customized for the user's needs.
  • Term—The length of the subscription determines the price adjustment. Available in API version 58.0 and later.
  • Volume—The quantity purchased determines the price adjustment.
The default value is Volume.

Usage

When you create a PriceAdjustmentSchedule, you associate PriceAdjustmentTiers with it. A PriceAdjustmentSchedule is inactive until at least one PriceAdjustmentTier is added to it. A PriceAdjustmentSchedule comprises all related PriceAdjustmentTiers, with a maximum limit of 25 PriceAdjustmentTiers for Subscription Management.

To use PriceAdjustmentSchedule, associate it with a PriceBookEntry.

  • You can associate a PriceBookEntry with up to five PriceAdjustmentSchedules, but only one PriceAdjustmentSchedule can be associated with a PriceBookEntry.
  • When you activate or deactivate a PriceAdjustmentSchedule, its PriceBookEntry association is also activated or deactivated.
  • An adjustment to a PriceBookEntry is applied only if the associated PriceAdjustmentSchedule is active.
  • After a PriceAdjustmentSchedule is associated with a PriceBookEntry, if multicurrency is enabled, the currencyIsoCode field can’t be modified.
  • When you associate a PriceAdjustmentSchedule with a PricebookEntry, a junction object PricebookEntryAdjustment is created.

You can modify the PriceAdjustmentTier object, and the ScheduleType and AdjustmentMethod fields, only when a PriceAdjustmentSchedule is inactive.

Code Sample

1public void priceAdjustmentScheduleSample() 
2                {try 
3                  /* This code snippet will do the following:
4		 * 
5		 * 1. Create a new Price Adjustment Schedule
6		 * 2. Create and attach a Price Adjustment Tier to the Schedule
7		 * 3. Activate the Schedule
8		 * 4. Create a new PricebookEntry Adjustment. This will associate the Schedule to a Pricebook Entry. */
9 
10		//Create a Price Adjustment Schedule
11		PriceAdjustmentSchedule pas = new PriceAdjustmentSchedule();
12		pas.Name = 'Sample PAS';
13		pas.Description = 'Sample Price Adjustment Schedule';
14		pas.AdjustmentMethod = 'Range';
15		insert pas;
16 
17		//Attach a valid Price Adjustment Tier
18		PriceAdjustmentTier pat = new PriceAdjustmentTier();
19		pat.PriceAdjustmentScheduleId = pas.Id;
20		pat.LowerBound = 1.0;
21		pat.UpperBound = 100.0;
22		pat.TierType = 'AdjustmentPercentage';
23		pat.TierValue = 5.0;
24		insert pat;
25 
26		//Activate the Schedule
27		pas.IsActive = true;
28		upsert pas;
29 
30		//Create a new PricebookEntry Adjustment
31		PricebookEntryAdjustment pbea = new PricebookEntryAdjustment();
32		pbea.PricebookEntryId = '01uRM0000007Hb5YAE';
33		pbea.PriceAdjustmentScheduleId = pas.Id;
34		insert pbea;
35 
36	} catch (ConnectionException ce) {
37		ce.printStackTrace();
38	}
39}