This global method clones line items from one configuration to another using Line Number.

clonePrimaryItemCollstatic Id clonePrimaryItemColl(Id configId, Integer lineNumber, Id targetConfigId)

Request Parameter
configIdIdThe ID of source product configuration associated with the line items.
lineNumberIntegerThe Line Number of the line items you want to clone.
targetConfigIdIdThe ID of the product configuration you want to clone the line items into.

Response Parameters
clonedPrimaryLineNumberIdThe 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;