You can use this API to retrieve the list Option Group associated with a product.

APISignature
getChildOptionGroupswebService static Apttus_Config2.CPQAdminStruct.HierarchyResponseDO getChildOptionGroups(Apttus_Config2.CPQAdminStruct.HierarchyRequestDO hierarchyRequestDO)



Request Parameter
NameTypeDescription
hierarchyRequestDOApttus_Config2.CPQAdminStruct.HierarchyRequestDOThe option group request data object.
Request Parameter - Apttus_Config2.CPQAdminStruct.HierarchyRequestDO
NameTypeDescription
ProductIDIdsThe ID of the product for which you want to retrieve option groups.



Response Data Object- Apttus_Config2.CPQAdminStruct.HierarchyResponseDO
NameTypeDescription
OptionGroupIdList<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;
}
CODE