You can invoke this global method for changing Assets.

APISignature
changeAssetsstatic Apttus_Config2.CPQStruct.ChangeAssetsResponseDO changeAssets(Apttus_Config2.CPQStruct.ChangeAssetsRequestDO request)
Parameters

Name

Type

Description

request

Apttus_Config2.CPQStruct.ChangeAssetsRequestDO

Request object invoked by the method

Request Data Object - Apttus_Config2.CPQStruct.ChangeAssetsRequestDO

Name

Type

Description

AssetId

List<ID>

List of Asset IDs to change.

CartId

ID

The id of Cart for which an asset is being changed.

Response Data Object - Apttus_Config2.CPQStruct.ChangeAssetsResponseDO

Field

Type

Description

Map <ID, LineItem__c>

LineItemMap

Returns all line items with all their field values.


Code Sample

The code sample below helps you make changes to an Asset by invoking this global method.

// create list of asset ids
List<ID> listAssetId = new List<ID>();
for (AssetLineItemWrapperClass record : wrapperAssetLineItemList) 
{
    if (record.selected) 
	{
        listAssetId.add(record.assetId);
    }
}

// create and populate request object
Apttus_Config2.CPQStruct.ChangeAssetsRequestDO request = new Apttus_Config2.CPQStruct.ChangeAssetsRequestDO();
request.AssetIds = listAssetId;
request.CartId = cartId;

// call changeAssets API
Apttus_Config2.CPQStruct.ChangeAssetsResponseDO response = Apttus_Config2.AssetService.changeAssets(request);

ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.info, 'changeAssets: ' + response));
CODE