The global method setSplitCartInfo is used to group the line items in the cart for pricing. You can define the parameters, namely the threshold and the split criteria based on which you want to split the line items in the cart through the API. If you do not define the parameters, the values of settings Split Cart Threshold and Split Cart Criteria Fields in Config System Properties are used to split the line items instead.


APISignature
setSplitCartInfostatic void setSplitCartInfo(Id cartId, Apttus_Config2.CustomClass.SplitCartInfo splitInfo)


Parameters
NameTypeRequired?Description
cartIdIDYesThe id of the Cart you want to split.
splitInfoApttus_Config2.CustomClass.CustomClass.SplitCartInfoYesThe request object.


Request Object - Apttus_Config2.CustomClass.SplitCartInfo
FieldTypeDescription
SplitCriteriaFieldsListThe list of API names of the fields to use as criteria.
SplitThresholdIntegerThe number of line items in a group.


Code Sample

The sample below enables you to set the values of Split Cart Threshold and Split Cart Criteria Fields to define the information required to split a cart.

//Setting Split info
Apttus_Config2.CustomClass.SplitCartInfo splitInfo = new Apttus_Config2.CustomClass.SplitCartInfo();
splitInfo.SplitCriteriaFields.add('Apttus_Config2_LocationId_c');
splitInfo.SplitThreshold = 10;
//Calling SplitInfo
// cartID can be Main Cart Id or Config Cart Id
ID cartID = 'a1I2f00000029Iy';
Apttus_Config2.CPQWebService.setSplitCartInfo(cartID , splitInfo);
CODE