Request Data Object - Apttus_Config2.CPQStruct.QueryAssetsRequestDO
Field
Type
Description
AccountIds
List <Id>
List of Account Ids
CustomFilter
String
SOQL condition expression used as a custom filter. For example, user could request only assets after a given billing end date.
This is optional.
Descending
Boolean
This indicates whether the assets are sorted in descending order
FieldNames
List
This can be used to include fields you have added to the Asset Line Item object.
Nrecord
Integer
This can be used to limit the number of records returned
Offset
Integer
This can be used to include an offset
SortFields
List
This can be used sort the result based on a list of fields.
Response Data Object - Apttus_Config2.CPQStruct.QueryAssetsResponseDO
Field
Type
Description
AssetCount
Integer
The 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 > 2019-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));