You can use this API to retrieve the list of options associated with a given option group.

APISignature
getChildOptions

webService static Apttus_Config2.CPQAdminStruct.HierarchyResponseDO getChildOptions(Apttus_Config2.CPQAdminStruct.HierarchyRequestDO hierarchyRequestDO)



Request Parameter
NameTypeDescription
hierarchyRequestDOApttus_Config2.CPQAdminStruct.HierarchyRequestDOThe category request data object.
Request Parameter - Apttus_Config2.CPQAdminStruct.HierarchyRequestDO
NameTypeDescription
HierarchyDOsList<Apttus_Config2.CPQAdminStruct.HierarchyDO>The list of hierarchy data object



Data Object- Apttus_Config2.CPQAdminStruct.HierarchyDO
NameTypeDescription
ChildProductIdIdThe Id of child product.
ParentProductIdIdThe Id of the parent product.
Response Data Object- Apttus_Config2.CPQAdminStruct.HierarchyResponseDO
NameTypeDescription
ProductStructureJSONs

 List<Apttus_Config2.CPQAdminStruct.MapDO>


 The list of map, where the  key is the option group Id and value is the JSON string of the product
Response Data Object - Apttus_Config2.CPQAdminStruct.MapDO
FieldTypeDescription
StringKeyThe option group ID
StringValueThe value refers to the JSON String of the product.


Code Sample

The below sample code returns the list of options for the given product and the option group.


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