Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

download

Adding and Removing Attributes from an Attribute Group

You can use this API to add or remove attributes from attributes groups.

API

Signature

updateAttributeGroup

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

Request Parameter

Name

Type

Description

prodAttrRequestDO Apttus_Config2.CPQAdminStruct.ProductAttributeRequestDO

The product attributes request data object.

Request Data Object - Apttus_Config2.CPQAdminStruct.ProductAttributeRequestDO

Name

Type

Description

ProductAttributeDOs List<Apttus_Config2.CPQAdminStruct.ProductAttributeDO>

The list of product attribute data objects.

ProductAttributeGroupMemberSOs List<Apttus_Config2__ ProductAttributeGroupMember__c>

The list of attributes to be added to or removed from the attribute group.

Data Object - Apttus_Config2.CPQAdminStruct.ProductAttributeDO

Name

Type

Description

AttirbuteGroupId Id

The ID of the attribute group.

AttributeGroupName String

The name of the attribute group you need to associate attributes to.

ProductAttributesToAdd List <String>

The API name of the attributes you want to add to the attribute group.

ProductAttributesToRemove List <String>

The API name of the attributes you want to remove from the attribute group.

ProductId Id

The ID of the product.

Response Parameter - Apttus_Config2.CPQAdminStruct.ProductAttributeResponseDO

Field

Type

Description

ProductAttributeGroupResponseMap List<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.

Success Boolean

Indicates whether the attributes were added or removed successfully.

Response Data Object - Apttus_Config2.CPQAdminStruct.MapDO

Field

Type

Description

String Key

The name of the attribute group.

String Value

The value refers record of the attribute group updated.

Code Sample

The sample code below enables you to add attributes in an attribute group

public Boolean addAttributesToAttributeGroups(Id attributeGroupId, List<String> attributeList) { Apttus_Config2.CPQAdminStruct.ProductAttributeDO requestAttributeDO = new Apttus_Config2.CPQAdminStruct.ProductAttributeDO(); requestAttributeDO. AttributeGroupId = attributeGroupId; requestAttributeDO.ProductAttributesToAdd = attributeList; 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.updateAttributeGroup(requestDO); return response.Success; }

The sample code below enables you to remove attributes from an attribute group

public Map<Apttus_Config2__ProductAttributeGroup__c> removeAttributesFromAttributeGroups(Id attributeGroupId, List<String> attributeList) { Apttus_Config2.CPQAdminStruct.ProductAttributeDO requestAttributeDO = new Apttus_Config2.CPQAdminStruct.ProductAttributeDO(); requestAttributeDO. AttributeGroupId = attributeGroupId; requestAttributeDO.ProductAttributesToRemove = attributeList; 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.updateAttributeGroup(requestDO); return response.Success; }