The ID of the product for which you want to retrieve option groups.
Response Data Object- Apttus_Config2.CPQAdminStruct.HierarchyResponseDO
Name
Type
Description
OptionGroupId
List<Id>
The Id option associated with the product.
Code Sample
The below sample code returns the list of option group Ids that are associated with a given product name.
public Apttus_Config2.CPQAdminStruct.HierarchyResponseDO getChildOptions(String productName, String optionGroupName)
{
Apttus_Config2.CPQAdminStruct.HierarchyDO hierDO = new Apttus_Config2.CPQAdminStruct.HierarchyDO();
Apttus_Config2.CPQAdminStruct.HierarchyRequestDO hierRequest = new Apttus_Config2.CPQAdminStruct.HierarchyRequestDO();
Apttus_Config2.CPQAdminStruct.HierarchyResponseDO hierResponse = null;
// get product and option group
Product2 prod = [SELECT Id FROM Product2 WHERE Name = :productName LIMIT 1];
Apttus_Config2__ClassificationHierarchy__c optionGroup = [SELECT Id FROM Apttus_Config2__ClassificationHierarchy__c WHERE Name = :optionGroupName LIMIT 1];
hierRequest.ProductId = prod.Id;
hierRequest.OptionGroupId = optionGroup.Id;
hierResponse = Apttus_Config2.CPQAdminWebService.getChildOptions(hierRequest);
return hierResponse;
}