You can use this API to associate attribute group and products.

APISignature
associateAttributeGroup

webService static Apttus_Config2.CPQAdminStruct.ProductAttributeResponseDO associateAttributeGroup(Apttus_Config2.CPQAdminStruct.ProductAttributeRequestDO prodAttrRequestDO)



Request Parameter
NameTypeDescription
prodAttrRequestDOApttus_Config2.CPQAdminStruct.ProductAttributeRequestDOThe product attribute request data object.



Request Data Object - Apttus_Config2.CPQAdminStruct.ProductAttributeRequestDO
NameTypeDescription
ProductAttributeDOsList<Apttus_Config2.CPQAdminStruct.ProductAttributeDO>The list of product attribute data objects.
ProductAttributeGroupMemberSOsList<Apttus_Config2__ ProductAttributeGroupMember__c>The list of attributes for the product attribute group.
Data Object - Apttus_Config2.CPQAdminStruct.ProductAttributeDO
NameTypeDescription
AttributeGroupNameStringThe name of the attribute group you need to associate with the product.
ProductAttributesToAddList <String>The API name of the attributes you want to add to the attribute group.
ProductAttributesToRemoveList <String>The API name of the attributes you want to remove from the attribute group.
ProductIdIdThe ID of the product.
Response Parameter - Apttus_Config2.CPQAdminStruct.ProductAttributeResponseDO
FieldTypeDescription
ProductAttributeGroupResponseMapList<Apttus_Config2.CPQAdminStruct.MapDO>The list of key-value pairs. The key refers to the attribute group name that you provided and the value contains the record ID.
SuccessBooleanIndicates whether the attribute group was associated successfully or not.
Response Data Object - Apttus_Config2.CPQAdminStruct.MapDO
FieldTypeDescription
StringKeyThe name of the attribute group.
StringValueThe value refers record of the associated attribute group.


Code Sample

The sample code below enables you associates products and an attribute group.


public List<Apttus_Config2__ProductAttributeGroupMember__c> asscociateAttributeGroups(Id attributeGroupId, Id productId)
{
	Apttus_Config2.CPQAdminStruct.ProductAttributeDO requestAttributeDO = new Apttus_Config2.CPQAdminStruct.ProductAttributeDO();

	requestAttributeDO.AttributeGroupId = attributeGroupId;
	requestAttributeDO.ProductId = productId;

	Apttus_Config2.CPQAdminStruct.ProductAttributeRequestDO requestDO = new Apttus_Config2.CPQAdminStruct.ProductAttributeRequestDO();

	requestDO.ProductAttributeDOs = new List<Apttus_Config2.CPQAdminStruct.ProductAttributeDO> {requestAttributeDO};

	Apttus_Config2.CPQAdminStruct.ProductAttributeResponseDO response = Apttus_Config2.CPQAdminWebService.associateAttributeGroup(requestDO);
	return response.ProductAttributeGroupMemberSOs;
}
CODE