This global method gets the count of Asset Line Item in one or more accounts.

APISignature
countAssetLineItemsstatic Apttus_Config2.CPQStruct.QueryAssetsResponseDO countAssetLineItems(Apttus_Config2.CPQStruct.QueryAssetsRequestDO request)
Parameters

Name

Type

Description

request

Apttus_Config2.CPQStruct.QueryAssetsRequestDO

Request object invoked by the method

Request Data Object - Apttus_Config2.CPQStruct.QueryAssetsRequestDO

Field

Type

Description

AccountIds

List <Id>

List of Account Ids

CustomFilterString

SOQL condition expression used as a custom filter. For example, user could request only assets after a given billing end date.

This is optional.

DescendingBoolean This indicates whether the assets are sorted in descending order
FieldNamesList This can be used to include fields you have added to the Asset Line Item object.
NrecordIntegerThis can be used to limit the number of records returned
OffsetInteger This can be used to include an offset
SortFieldsList This can be used sort the result based on a list of fields.

Response Data Object - Apttus_Config2.CPQStruct.QueryAssetsResponseDO

Field

Type

Description

AssetCountIntegerThe number of assets returned

AssetLineItems

List

List of Asset Line Items.


Code Sample

The code sample below helps you get a count of Asset Line Items for a particular account. Use this global method to fetch all asset line items associated with an account.

// create list of account ids
List<ID> listAccount = new List<ID>(); 
listAccount.add(accountId);

// create and populate request object
Apttus_Config2.CPQStruct.QueryAssetsRequestDO request = new Apttus_Config2.CPQStruct.QueryAssetsRequestDO();
request.AccountIds = listAccount;
request.CustomFilter = 'Apttus_Config2__BillingEndDate__c > 2011-04-30'; // optional

// call countAssetLineItems API
Apttus_Config2.CPQStruct.QueryAssetsResponseDO response = Apttus_Config2.AssetService.countAssetLineItems(request);

ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.info,'Asset Line Item Count: ' + response.AssetCount));
CODE