Data Object - Apttus_Config2.CPQAdminStruct.ProductDO
Name
Type
Description
ProductId
Id
The ID of the product you want to associate with the category
CategoryId
Id
The Id of the category to which the products must be associated to.
Response Parameter
Name
Type
Description
IsSuccessful
Boolean
Indicates whether the association of product to the category was successful or not.
Code Sample
The below sample code enables you to associate the product to a specific category.
/**
* The below code associate the products with related category. Invoke below method by passing map of productid and categoryId as parameter.
*/
Public Boolean associateProductToCategory(Map<Id, Id> mapProductIdCategoryId)
{
Apttus_Config2.CPQAdminStruct.ProductRequestDO prodsAssocRequest = new Apttus_Config2.CPQAdminStruct.ProductRequestDO();
CPQAdminStruct.ProductDO prodForAssociation = null;
For (Id productId : mapProductIdCategoryId. keySet()) {
prodForAssociation.productID = prodIDs[i];
prodForAssociation.categoryID = categIDs[i];
prodsAssocRequest.ProductDOs.add(prodForAssociation);
}
return Apttus_Config2.CPQAdminWebService.associateProductToCategory(prodsAssocRequest);
}