This global method clones line items from one configuration to another using Line Number.
API
Signature
clonePrimaryItemColl
static Id clonePrimaryItemColl(Id configId, Integer lineNumber, Id targetConfigId)
Request Parameter
Name
Type
Description
configId
Id
The ID of source product configuration associated with the line items.
lineNumber
Integer
The Line Number of the line items you want to clone.
targetConfigId
Id
The ID of the product configuration you want to clone the line items into.
Response Parameters
Field
Type
Description
clonedPrimaryLineNumber
Id
The Line number of the cloned primary line item collection.
Code Sample
The sample code below enables you to clone line items associated with a Line Number and add them to the target configuration. This returns the line number of the cloned line items.
/**
* Clones the given primary line item collection and adds it onto the target configuration
* @param parentConfigId the id of the product configuration associated with the line items.
* @param primaryLineNumber the line number associated with the item collection
* @param childConfigId the id of child product configuration
* @return the Id of the new primary line item collection
*/
public Id clonePrimaryItemCollection(Id parentConfigId, Integer primaryLineNumber, Id childConfigId)
{
Id clonedPrimaryLineNumber;
clonedPrimaryLineNumber = Apttus_Config2.CPQWebService.clonePrimaryItemColl(parentConfigId, primaryLineNumber, childConfigId);
return clonedPrimaryLineNumber;
}