Get a List of Assets
This API returns the list of asset line items of various accounts.
API |
Signature |
---|---|
getAssetLineItems |
WebService static Apttus_CPQApi.CPQAsset.QueryAssetsResponseDO getAssetLineItems(Apttus_CPQApi.CPQAsset.QueryAssetsRequestDO request) |
Parameters |
||
---|---|---|
Name |
Type |
Description |
request | Apttus_CPQApi.CPQAsset.QueryAssetsRequestDO |
Request object passed by the invoker method. |
Request Data Object - Apttus_CPQApi.CPQAsset.QueryAssetsRequestDO |
||
---|---|---|
Name |
Type |
Description |
AccountIds | List<ID> |
List of account IDs. |
FieldNames | List<String> |
Optional. Use this to include fields you have added to an Asset Line Item object. |
CustomFilter | String |
Optional. SOQL condition expression used as a custom filter. For example, you can request only assets after a specified billing end date. |
Descending | Boolean |
Optional. This indicates whether assets are sorted in descending order. |
SortFields | List<String> |
Optional. This can be used sort the result based on a list of fields. |
Offset | Integer |
Optional. This can be used to include an offset. |
Nrecord | Integer |
Optional. This can be used to limit the number of records returned. |
Response Data Object - Apttus_CPQApi.CPQAsset.QueryAssetsResponseDO |
||
---|---|---|
Field |
Type |
Description |
AssetCount | Integer |
N/A |
AssetLineItems | List<Apttus_Config2__AssetLineItem__c> |
List of asset line items. |
Errors | List<String> |
List of error messages if any error occurred. |
Code Sample
The following code sample helps you get a list of asset line items of various accounts.
Public Apttus_CPQApi.CPQAsset.QueryAssetsResponseDO getAssetLineItems ()
{
Apttus_CPQApi.CPQAsset.QueryAssetsRequestDO request = new Apttus_CPQApi.CPQAsset.QueryAssetsRequestDO();
request.AccountIds = new List<ID>{'0012f00000BQd03'};
request.CustomFilter = 'Apttus_Config2__PriceType__c = \'Recurring\''; // optional
// retrieve all fields in Asset Line Item sObject
request.FieldNames = null;
// sort by billing end date (optional)
request.SortFields = new List{'Apttus_Config2__BillingEndDate__c'};
// call countAssetLineItems API
Apttus_CPQApi.CPQAsset.QueryAssetsResponseDO response =
Apttus_CPQApi.CPQAssetWebService.getAssetLineItems (request);
return response;
}