This Apex object represents an in-memory CartItem record and its relationships with other records. All formula and roll-up summary standard fields are updated at runtime. Loading and saving this object is not possible in Apex but is done by Salesforce.
See Object Reference: CartItem
Constructors
global CartItem(SalesItemTypeEnum salesItemType, CartDeliveryGroup cartDeliveryGroup, String name)
Constructor for CartItem object. All arguments are required.
Parameters
Param
Description
salesItemType
Initial value for CartItem.Type.
cartDeliveryGroup
Initial CartExtension.CartDeliveryGroup object related to this object. Its ID will be saved in CartItem.CartDeliveryGroupId.
global void setSubType(CartItemSubTypeEnum subType)
Set CartItem.SubType.
Returns
Type
Description
void
global String getName()
Get CartItem.Name.
Returns
Type
Description
String
global void setName(String name)
Set CartItem.Name.
Returns
Type
Description
void
global ID getProduct2Id()
Get CartItem.Product2Id.
Returns
Type
Description
ID
global void setProduct2Id(ID productId)
Set CartItem.Product2Id.
Returns
Type
Description
void
global String getSku()
Get CartItem.Sku.
Returns
Type
Description
String
global void setSku(String sku)
Set CartItem.Sku.
Returns
Type
Description
void
global Decimal getQuantity()
Get CartItem.Quantity.
Returns
Type
Description
Decimal
global void setQuantity(Decimal quantity)
Set CartItem.Quantity.
Returns
Type
Description
void
global Decimal getListPrice()
Get CartItem.ListPrice.
Returns
Type
Description
Decimal
global void setListPrice(Decimal listPrice)
Get CartItem.ListPrice.
Returns
Type
Description
void
global Decimal getSalesPrice()
Get CartItem.SalesPrice.
Returns
Type
Description
Decimal
global void setSalesPrice(Decimal salesPrice)
Set CartItem.SalesPrice.
Returns
Type
Description
void
global Decimal getUnitAdjustedPrice()
Get CartItem.UnitAdjustedPrice.
Returns
Type
Description
Decimal
global void setUnitAdjustedPrice(Decimal unitAdjustedPrice)
Set CartItem.UnitAdjustedPrice.
Returns
Type
Description
void
global void setUnitItemAdjustmentAmount(Decimal unitItemAdjustmentAmount)
Set CartItem.UnitItemAdjustmentAmount.
Returns
Type
Description
void
global Decimal getUnitItemAdjustmentAmount()
Get CartItem.UnitItemAdjustmentAmount.
Returns
Type
Description
Decimal
global void setUnitAdjustedPriceWithItemAdj(Decimal unitAdjustedPriceWithItemAdj)
Set CartItem.UnitAdjustedPriceWithItemAdj.
Returns
Type
Description
void
global Decimal getUnitAdjustedPriceWithItemAdj()
Get CartItem.UnitAdjustedPriceWithItemAdj.
Returns
Type
Description
Decimal
global void setTotalListPrice(Decimal totalListPrice)
Set CartItem.TotalListPrice.
Returns
Type
Description
void
global Decimal getTotalListPrice()
Get CartItem.TotalListPrice.
Returns
Type
Description
Decimal
global void setTotalFirstPymtListPrice(Decimal totalFirstPymtListPrice)
Set CartItem.TotalFirstPymtListPrice.
Returns
Type
Description
void
global Decimal getTotalFirstPymtListPrice()
Get CartItem.TotalFirstPymtListPrice.
Returns
Type
Description
Decimal
global Decimal getTotalPrice()
Get CartItem.TotalPrice.
Returns
Type
Description
Decimal
global void setTotalPrice(Decimal totalPrice)
Set CartItem.TotalPrice.
Returns
Type
Description
void
global Decimal getNetUnitPrice()
Get CartItem.NetUnitPrice.
Returns
Type
Description
Decimal
global void setNetUnitPrice(Decimal netUnitPrice)
Set CartItem.NetUnitPrice.
Returns
Type
Description
void
global Decimal getGrossUnitPrice()
Get CartItem.GrossUnitPrice.
Returns
Type
Description
Decimal
global void setGrossUnitPrice(Decimal grossUnitPrice)
Set CartItem.GrossUnitPrice.
Returns
Type
Description
void
global Decimal getTotalLineTaxAmount()
Get CartItem.TotalLineTaxAmount.
Returns
Type
Description
Decimal
global Decimal getItemizedAdjustmentAmount()
Get CartItem.ItemizedAdjustmentAmount.
Returns
Type
Description
Decimal
global Decimal getDistributedAdjustmentAmount()
Get CartItem.DistributedAdjustmentAmount.
Returns
Type
Description
Decimal
global Decimal getAdjustmentAmount()
Get CartItem.AdjustmentAmount.
Returns
Type
Description
Decimal
global void setAdjustmentAmount(Decimal adjustmentAmount)
Set CartItem.AdjustmentAmount.
Returns
Type
Description
void
global void setTotalPromoAdjustmentAmount(Decimal totalPromoAdjustmentAmount)
Set CartItem.TotalPromoAdjustmentAmount.
Returns
Type
Description
void
global Decimal getTotalPromoAdjustmentAmount()
Get CartItem.TotalPromoAdjustmentAmount.
Returns
Type
Description
Decimal
global Decimal getTotalTaxAmount()
Get CartItem.TotalTaxAmount.
Returns
Type
Description
Decimal
global Decimal getTotalLineAmount()
Get CartItem.TotalLineAmount.
Returns
Type
Description
Decimal
global void setTotalLineAmount(Decimal totalLineAmount)
Set CartItem.TotalLineAmount.
Returns
Type
Description
void
global Decimal getTotalAmount()
Get CartItem.TotalAmount.
Returns
Type
Description
Decimal
global Decimal getItemizedAdjustmentTaxAmount()
Get CartItem.ItemizedAdjustmentTaxAmount.
Returns
Type
Description
Decimal
global Decimal getDistributedAdjustmentTaxAmount()
Get CartItem.DistributedAdjustmentTaxAmount.
Returns
Type
Description
Decimal
global Decimal getAdjustmentTaxAmount()
Get CartItem.AdjustmentTaxAmount.
Returns
Type
Description
Decimal
global void setAdjustmentTaxAmount(Decimal adjustmentTaxAmount)
Set CartItem.AdjustmentTaxAmount.
Returns
Type
Description
void
global Decimal getTotalPriceAfterAllAdjustments()
Get CartItem.TotalPriceAfterAllAdjustments.
Returns
Type
Description
Decimal
global void setTotalPriceAfterAllAdjustments(Decimal totalPriceAfterAllAdjustments)
Set CartItem.TotalPriceAfterAllAdjustments.
Returns
Type
Description
void
global Decimal getUnitAdjustmentAmount()
Get CartItem.UnitAdjustmentAmount.
Returns
Type
Description
Decimal
global void setUnitAdjustmentAmount(Decimal unitAdjustmentAmount)
Set CartItem.UnitAdjustmentAmount.
Returns
Type
Description
void
global Decimal getTotalAdjustmentAmount()
Get CartItem.TotalAdjustmentAmount.
Returns
Type
Description
Decimal
global void setTotalAdjustmentAmount(Decimal totalAdjustmentAmount)
Set CartItem.TotalAdjustmentAmount.
Returns
Type
Description
void
global CartItemPriceAdjustmentList getCartItemPriceAdjustments()
Get all CartExtension.CartItemPriceAdjustment objects associated with the current CartItem. Specifically, fetch CartItemPriceAdjustment instances where the CartItemPriceAdjustment.CartItem matches the ID of the current CartItem.
Get all CartExtension.CartTax objects associated with the current CartItem. Specifically, fetch CartTax instances where the CartTax.CartItem matches the ID of the current CartItem. This method doesn’t include tax adjustments that are related to item price adjustments for the CartItem, such as CartTax related to a CartItemPriceAdjustment.