CartExtension.CartItem

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 

ParamDescription
salesItemTypeInitial value for CartItem.Type.
cartDeliveryGroupInitial CartExtension.CartDeliveryGroup object related to this object. Its ID will be saved in CartItem.CartDeliveryGroupId.
nameInitial value for CartItem.Name.

Methods 

global CartDeliveryGroup getCartDeliveryGroup() 

Get the CartExtension.CartDeliveryGroup object whose ID was saved in CartItem.Id.

Returns 

TypeDescription
CartDeliveryGroupCartExtension.CartDeliveryGroup

global void setCartDeliveryGroup(CartDeliveryGroup cartDeliveryGroup) 

Set the related CartExtension.CartDeliveryGroup object whose ID is stored in CartItem.Id on save.

Returns 

TypeDescription
voidCartExtension.CartDeliveryGroup

global CartItem getParentCartItem() 

Get the Parent CartExtension.CartItem object whose ID was saved in CartItem.Id.

Returns 

TypeDescription
CartItemCartExtension.CartItem

global void setParentCartItem(CartItem parentCartItem) 

Set the related Parent CartExtension.CartItem object whose ID is stored in CartItem.Id on save.

Returns 

TypeDescription
voidCartExtension.CartItem

global CartItemList getChildCartItems() 

Get all the related CartExtension.CartItem objects.

Returns 

TypeDescription
CartItemListCartExtension.CartItemList

global SalesItemTypeEnum getType() 

Get CartItem.Type.

Returns 

TypeDescription
SalesItemTypeEnumCartExtension.SalesItemTypeEnum

global CartItemSubTypeEnum getSubType() 

Get CartItem.SubType.

Returns 

TypeDescription
CartItemSubTypeEnumCartExtension.CartItemSubTypeEnum

global void setSubType(CartItemSubTypeEnum subType) 

Set CartItem.SubType.

Returns 

TypeDescription
void

global String getName() 

Get CartItem.Name.

Returns 

TypeDescription
String

global void setName(String name) 

Set CartItem.Name.

Returns 

TypeDescription
void

global ID getProduct2Id() 

Get CartItem.Product2Id.

Returns 

TypeDescription
ID

global void setProduct2Id(ID productId) 

Set CartItem.Product2Id.

Returns 

TypeDescription
void

global String getSku() 

Get CartItem.Sku.

Returns 

TypeDescription
String

global void setSku(String sku) 

Set CartItem.Sku.

Returns 

TypeDescription
void

global Decimal getQuantity() 

Get CartItem.Quantity.

Returns 

TypeDescription
Decimal

global void setQuantity(Decimal quantity) 

Set CartItem.Quantity.

Returns 

TypeDescription
void

global Decimal getListPrice() 

Get CartItem.ListPrice.

Returns 

TypeDescription
Decimal

global void setListPrice(Decimal listPrice) 

Get CartItem.ListPrice.

Returns 

TypeDescription
void

global Decimal getSalesPrice() 

Get CartItem.SalesPrice.

Returns 

TypeDescription
Decimal

global void setSalesPrice(Decimal salesPrice) 

Set CartItem.SalesPrice.

Returns 

TypeDescription
void

global Decimal getUnitAdjustedPrice() 

Get CartItem.UnitAdjustedPrice.

Returns 

TypeDescription
Decimal

global void setUnitAdjustedPrice(Decimal unitAdjustedPrice) 

Set CartItem.UnitAdjustedPrice.

Returns 

TypeDescription
void

global void setUnitItemAdjustmentAmount(Decimal unitItemAdjustmentAmount) 

Set CartItem.UnitItemAdjustmentAmount.

Returns 

TypeDescription
void

global Decimal getUnitItemAdjustmentAmount() 

Get CartItem.UnitItemAdjustmentAmount.

Returns 

TypeDescription
Decimal

global void setUnitAdjustedPriceWithItemAdj(Decimal unitAdjustedPriceWithItemAdj) 

Set CartItem.UnitAdjustedPriceWithItemAdj.

Returns 

TypeDescription
void

global Decimal getUnitAdjustedPriceWithItemAdj() 

Get CartItem.UnitAdjustedPriceWithItemAdj.

Returns 

TypeDescription
Decimal

global void setTotalListPrice(Decimal totalListPrice) 

Set CartItem.TotalListPrice.

Returns 

TypeDescription
void

global Decimal getTotalListPrice() 

Get CartItem.TotalListPrice.

Returns 

TypeDescription
Decimal

global void setTotalFirstPymtListPrice(Decimal totalFirstPymtListPrice) 

Set CartItem.TotalFirstPymtListPrice.

Returns 

TypeDescription
void

global Decimal getTotalFirstPymtListPrice() 

Get CartItem.TotalFirstPymtListPrice.

Returns 

TypeDescription
Decimal

global Decimal getTotalPrice() 

Get CartItem.TotalPrice.

Returns 

TypeDescription
Decimal

global void setTotalPrice(Decimal totalPrice) 

Set CartItem.TotalPrice.

Returns 

TypeDescription
void

global Decimal getNetUnitPrice() 

Get CartItem.NetUnitPrice.

Returns 

TypeDescription
Decimal

global void setNetUnitPrice(Decimal netUnitPrice) 

Set CartItem.NetUnitPrice.

Returns 

TypeDescription
void

global Decimal getGrossUnitPrice() 

Get CartItem.GrossUnitPrice.

Returns 

TypeDescription
Decimal

global void setGrossUnitPrice(Decimal grossUnitPrice) 

Set CartItem.GrossUnitPrice.

Returns 

TypeDescription
void

global Decimal getTotalLineTaxAmount() 

Get CartItem.TotalLineTaxAmount.

Returns 

TypeDescription
Decimal

global Decimal getItemizedAdjustmentAmount() 

Get CartItem.ItemizedAdjustmentAmount.

Returns 

TypeDescription
Decimal

global Decimal getDistributedAdjustmentAmount() 

Get CartItem.DistributedAdjustmentAmount.

Returns 

TypeDescription
Decimal

global Decimal getAdjustmentAmount() 

Get CartItem.AdjustmentAmount.

Returns 

TypeDescription
Decimal

global void setAdjustmentAmount(Decimal adjustmentAmount) 

Set CartItem.AdjustmentAmount.

Returns 

TypeDescription
void

global void setTotalPromoAdjustmentAmount(Decimal totalPromoAdjustmentAmount) 

Set CartItem.TotalPromoAdjustmentAmount.

Returns 

TypeDescription
void

global Decimal getTotalPromoAdjustmentAmount() 

Get CartItem.TotalPromoAdjustmentAmount.

Returns 

TypeDescription
Decimal

global Decimal getTotalTaxAmount() 

Get CartItem.TotalTaxAmount.

Returns 

TypeDescription
Decimal

global Decimal getTotalLineAmount() 

Get CartItem.TotalLineAmount.

Returns 

TypeDescription
Decimal

global void setTotalLineAmount(Decimal totalLineAmount) 

Set CartItem.TotalLineAmount.

Returns 

TypeDescription
void

global Decimal getTotalAmount() 

Get CartItem.TotalAmount.

Returns 

TypeDescription
Decimal

global Decimal getItemizedAdjustmentTaxAmount() 

Get CartItem.ItemizedAdjustmentTaxAmount.

Returns 

TypeDescription
Decimal

global Decimal getDistributedAdjustmentTaxAmount() 

Get CartItem.DistributedAdjustmentTaxAmount.

Returns 

TypeDescription
Decimal

global Decimal getAdjustmentTaxAmount() 

Get CartItem.AdjustmentTaxAmount.

Returns 

TypeDescription
Decimal

global void setAdjustmentTaxAmount(Decimal adjustmentTaxAmount) 

Set CartItem.AdjustmentTaxAmount.

Returns 

TypeDescription
void

global Decimal getTotalPriceAfterAllAdjustments() 

Get CartItem.TotalPriceAfterAllAdjustments.

Returns 

TypeDescription
Decimal

global void setTotalPriceAfterAllAdjustments(Decimal totalPriceAfterAllAdjustments) 

Set CartItem.TotalPriceAfterAllAdjustments.

Returns 

TypeDescription
void

global Decimal getUnitAdjustmentAmount() 

Get CartItem.UnitAdjustmentAmount.

Returns 

TypeDescription
Decimal

global void setUnitAdjustmentAmount(Decimal unitAdjustmentAmount) 

Set CartItem.UnitAdjustmentAmount.

Returns 

TypeDescription
void

global Decimal getTotalAdjustmentAmount() 

Get CartItem.TotalAdjustmentAmount.

Returns 

TypeDescription
Decimal

global void setTotalAdjustmentAmount(Decimal totalAdjustmentAmount) 

Set CartItem.TotalAdjustmentAmount.

Returns 

TypeDescription
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.

Returns 

TypeDescription
CartItemPriceAdjustmentListCartExtension.CartItemPriceAdjustmentList

global CartTaxList getCartTaxes() 

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.

Returns 

TypeDescription
CartTaxListCartExtension.CartTaxList

global Decimal getTotalLineNetAmount() 

Get CartItem.TotalLineNetAmount.

Returns 

TypeDescription
Decimal

global Decimal getTotalLineGrossAmount() 

Get CartItem.TotalLineGrossAmount.

Returns 

TypeDescription
Decimal

global ID getProductSellingModelId() 

Get CartItem.ProductSellingModelId. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
ID

global Integer getSubscriptionTerm() 

Get CartItem.SubscriptionTerm. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
Integer

global BillingFrequencyEnum getBillingFrequency() 

Get CartItem.BillingFrequency. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
BillingFrequencyEnumCartExtension.BillingFrequencyEnum

global void setBillingFrequency(BillingFrequencyEnum billingFrequency) 

Set CartItem.BillingFrequency. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
void

global PeriodBoundaryEnum getPeriodBoundary() 

Get CartItem.PeriodBoundary.

Returns 

TypeDescription
PeriodBoundaryEnumCartExtension.PeriodBoundaryEnum

global Integer getPeriodBoundaryDay() 

Get CartItem.PeriodBoundaryDay.

Returns 

TypeDescription
IntegerInteger

global Integer getPeriodBoundaryStartMonth() 

Get CartItem.PeriodBoundaryStartMonth.

Returns 

TypeDescription
IntegerInteger

global Decimal getPricingTermCount() 

Get CartItem.PricingTermCount. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
Decimal

global void setPricingTermCount(Decimal pricingTermCount) 

Set CartItem.PricingTermCount. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
void

global ID getPricebookEntryId() 

Get CartItem.PricebookEntryId. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
ID

global void setPricebookEntryId(ID pricebookEntryId) 

Set CartItem.PricebookEntryId. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
void

global ID getProrationPolicyId() 

Get CartItem.ProrationPolicyId. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
ID

global void setProrationPolicyId(ID prorationPolicyId) 

Set CartItem.ProrationPolicyId. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
void

global SellingModelType getSellingModelType() 

Get CartItem.SellingModelType. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
SellingModelTypeCartExtension.SellingModelType

global void setSellingModelType(SellingModelType sellingModelType) 

Set CartItem.SellingModelType. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
void

global Decimal getUnitPriceAfterAdjustments() 

Get CartItem.UnitPriceAfterAdjustments. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
Decimal

global void setUnitPriceAfterAdjustments(Decimal unitPriceAfterAdjustments) 

Set CartItem.UnitPriceAfterAdjustments. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
void

global Decimal getNetUnitPriceAfterAdjustments() 

Get CartItem.NetUnitPriceAfterAdjustments. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
Decimal

global void setNetUnitPriceAfterAdjustments(Decimal netUnitPriceAfterAdjustments) 

Set CartItem.NetUnitPriceAfterAdjustments. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
void

global Decimal getFirstPymtPriceAfterAdjustments() 

Get CartItem.FirstPymtPriceAfterAdjustments. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
Decimal

global void setFirstPymtPriceAfterAdjustments(Decimal firstPymtPriceAfterAdjustments) 

Set CartItem.FirstPymtPriceAfterAdjustments. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
void

global Decimal getFirstPymtTax() 

Get CartItem.FirstPymtTax. This method is only available for organizations that have Commerce Subscription Plus enabled.

Returns 

TypeDescription
Decimal

global void setFirstPymtTax(Decimal firstPymtTax) 

Set CartItem.FirstPymtTax.

Returns 

TypeDescription
void

global Decimal getTotalFirstPymtPrice() 

Get CartItem.TotalFirstPymtPrice.

Returns 

TypeDescription
Decimal

global Decimal getTotalFirstPymtAdjAmount() 

Get CartItem.TotalFirstPymtAdjAmount.

Returns 

TypeDescription
Decimal

global Decimal getTotalLineFirstPymtTaxAmount() 

Get CartItem.TotalLineFirstPymtTaxAmount.

Returns 

TypeDescription
Decimal

global void setProductRelatedComponentId(ID productRelatedComponentId) 

Set CartItem.ProductRelatedComponentId.

Returns 

TypeDescription
void

global ID getProductRelatedComponentId() 

Get CartItem.ProductRelatedComponentId.

Returns 

TypeDescription
ID

global void setProductClass(ProductClass productClass) 

Set CartItem.ProductClass.

Returns 

TypeDescription
void

global ProductClass getProductClass() 

Get CartItem.ProductClass.

Returns 

TypeDescription
ProductClassCartExtension.ProductClass

global void setStockCheckMethod(StockCheckMethod stockCheckMethod) 

Set CartItem.StockCheckMethod

Returns 

TypeDescription
void

global StockCheckMethod getStockCheckMethod() 

Get CartItem.StockCheckMethod.

Returns 

TypeDescription
StockCheckMethodCartExtension.StockCheckMethod

global void setPerUnitWeight(Decimal perUnitWeight) 

Set CartItem.PerUnitWeight.

Returns 

TypeDescription
void

global Decimal getPerUnitWeight() 

Get CartItem.getPerUnitWeight.

Returns 

TypeDescription
DecimalDecimal

global void setWeightUnit(String weightUnit) 

Set CartItem.WeightUnit.

Returns 

TypeDescription
void

global String getWeightUnit() 

Get CartItem.getWeightUnit.

Returns 

TypeDescription
StringgetWeightUnit

global Decimal getTotalWeight() 

Get CartItem.getTotalWeight.

Returns 

TypeDescription
DecimalDecimal

global void setTaxTreatmentId(ID taxTreatmentId) 

Set CartItem.TaxTreatmentId.

Returns 

TypeDescription
void

global ID getTaxTreatmentId() 

Get CartItem.TaxTreatmentId.

Returns 

TypeDescription
IDTaxTreatmentId

global Boolean getIsShippingChargeNotApplicable() 

Get CartItem.IsShippingChargeNotApplicable.

Returns 

TypeDescription
BooleanBoolean

global void setIsShippingChargeNotApplicable(Boolean isShippingChargeNotApplicable) 

Set CartItem.IsShippingChargeNotApplicable.

Returns 

TypeDescription
void

global ID getId() 

Get Id.

Returns 

TypeDescription
ID

global Datetime getCreatedDate() 

Get System Field CreatedDate.

Returns 

TypeDescription
Datetime

global Datetime getLastModifiedDate() 

Get System Field LastModifiedDate.

Returns 

TypeDescription
Datetime

global ID getCreatedById() 

Get System Field CreatedById.

Returns 

TypeDescription
ID

global ID getLastModifiedById() 

Get System Field LastModifiedById.

Returns 

TypeDescription
ID

global Object getCustomField(String fieldName) 

Get value of the given custom field (needs to be api name)

Returns 

TypeDescription
Object

global void setCustomField(String fieldName, Object fieldValue) 

Set the value of the given custom field (needs to be api name)

Returns 

TypeDescription
void

public Boolean equals(Object obj) 

public Integer hashCode() 


Newer Version Available

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

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!