Gets the list of asset line item objects matching the parameters used as the search criteria.


APISignature
getAssetsForSearchTextwebService static Apttus_CPQApi.CPQ.AssetSearchResultDO getAssetsForSearchText(Id accountId, List locationIds, String searchText)

You cannot use the parameters accountId and locationIds simultaneously.

Parameters
NameTypeDescription
accountIdIDThe id of the account associated with the asset.
locationIdsList <ID>The ids of the different locations associated with the assets.
searchTextStringThe search text.



Response Data Object - Apttus_CPQApi.CPQ.AssetSearchResultDO
NameTypeDescription
AssetItemsList < Apttus_Config2__ AssetLineItem__c >This is a list of the asset line items. This returns the asset line item records and the values for the fields that belong to each record.
HasAssetItemsBooleanIndicates whether there are asset line items, that match the parameters used for the search.


Code Sample

When you generate a quote for an existing customer, it is possible that the customer has some assets associated with the account. You can provide a search field on the cart page that enables the customer to search for existing assets and view them. When the user types the search criteria for fetching the assets and clicks Search, invoke the API. This sample should enable the user to search a product by product name, product code, product description, category name, and configuration type. The search for get assets is similar to the product search in the catalog page and installed products page.

public void searchAssets() 
{
    Apttus_CPQApi.CPQ.AssetSearchResultDO assetResults = Apttus_CPQApi.CPQWebService.getAssetsForSearchText(accountId, null, assetSearchText);
    List<AssetWrapperClass> lstAssetWrapper = new List<AssetWrapperClass>();

    // if assets items that are searched by a keyword exist (i.e hasassetitems=true)
    // and some value is returned, show the following as a part of the list
    if (assetResults.HasAssetItems == true) 
	{
        List<Apttus_Config2__AssetLineItem__c> aliSOList = assetResults.AssetItems;
        for (Apttus_Config2__AssetLineItem__c aliSO : aliSOList) 
		{
            AssetWrapperClass objAssetWrapperClass = new AssetWrapperClass ();
            objAssetWrapperClass.AssetId = aliSO.ID;
            objAssetWrapperClass.ProductId = aliSO.Apttus_Config2__Description__c;
            objAssetWrapperClass.Quantity = aliSO.Apttus_Config2__Quantity__c;
            objAssetWrapperClass.StartDate = aliSO.Apttus_Config2__StartDate__c;
            objAssetWrapperClass.EndDate = aliSO.Apttus_Config2__EndDate__c;
            lstAssetWrapper.add(objAssetWrapperClass);
        }
    }
    
    // if there are no assets by the search text that the user entered,
    // display an appropriate message.
    else 
	{
        lstAssetWrapper.clear();
        ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.info, 'No result found. Please try again.'));
    }
}
CODE

Integration Details

Use the following information in your integrations with CPQ Web Services API. Refer to Integrating Conga with External Systems for information on how to get started.

Response/Request XML

Example Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cpq="http://soap.sforce.com/schemas/class/Apttus_CPQApi/CPQWebService">
   <soapenv:Header>
      <cpq:SessionHeader>
         <cpq:sessionId>00D4P000000z7dE!AQQAQGL6XYy.QsjqQQ6RTBnh.1ApTbiqkGAdVz9BS70lxobcyXgHHplmGXAe7p_cf6ziWJ8tpQt_4Q4Bi2VtYeMyzjhaPbf0</cpq:sessionId>
      </cpq:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <cpq:getAssetsForSearchText>
         <cpq:accountId>0014P000028PFFS</cpq:accountId>
         <!--<cpq:locationIds></cpq:locationIds>-->
         <cpq:searchText></cpq:searchText>
      </cpq:getAssetsForSearchText>
   </soapenv:Body>
</soapenv:Envelope>
XML

Example Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/schemas/class/Apttus_CPQApi/CPQWebService" xmlns:AssetSearchResultDO="http://soap.sforce.com/schemas/class/Apttus_CPQApi/CPQ" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <getAssetsForSearchTextResponse>
         <result>
            <AssetSearchResultDO:AssetItems xsi:type="Apttus_Config2__AssetLineItem__c">
               <Id>a114P000004ie6cQAA</Id>
               <Apttus_Config2__AccountId__c>0014P000028PFFSQA4</Apttus_Config2__AccountId__c>
               <Apttus_Config2__AssetStatus__c>Activated</Apttus_Config2__AssetStatus__c>
               <Apttus_Config2__BasePriceMethod__c>Per Unit</Apttus_Config2__BasePriceMethod__c>
               <Apttus_Config2__BasePrice__c>160.00000</Apttus_Config2__BasePrice__c>
               <Apttus_Config2__BusinessObjectId__c>a0c4P00000G3AikQAF</Apttus_Config2__BusinessObjectId__c>
               <Apttus_Config2__ChargeType__c>Standard Price</Apttus_Config2__ChargeType__c>
               <Apttus_Config2__Description__c>SecureCloud Enterprise</Apttus_Config2__Description__c>
               <Apttus_Config2__EndDate__c>2017-06-19</Apttus_Config2__EndDate__c>
               <Apttus_Config2__Frequency__c>Monthly</Apttus_Config2__Frequency__c>
               <Apttus_Config2__IsPrimaryLine__c>true</Apttus_Config2__IsPrimaryLine__c>
               <Apttus_Config2__IsPrimaryRampLine__c>false</Apttus_Config2__IsPrimaryRampLine__c>
               <Apttus_Config2__IsReadOnly__c>false</Apttus_Config2__IsReadOnly__c>
               <Apttus_Config2__IsUsageTierModifiable__c>false</Apttus_Config2__IsUsageTierModifiable__c>
               <Apttus_Config2__ItemSequence__c>1</Apttus_Config2__ItemSequence__c>
               <Apttus_Config2__LineNumber__c>1</Apttus_Config2__LineNumber__c>
               <Apttus_Config2__LineType__c>Product/Service</Apttus_Config2__LineType__c>
               <Apttus_Config2__MustUpgrade__c>false</Apttus_Config2__MustUpgrade__c>
               <Apttus_Config2__NetPrice__c>729600.00000</Apttus_Config2__NetPrice__c>
               <Apttus_Config2__PriceType__c>Recurring</Apttus_Config2__PriceType__c>
               <Apttus_Config2__ProductId__c>01t4P00000884AHQAY</Apttus_Config2__ProductId__c>
               <Apttus_Config2__ProductId__r xsi:type="Product2">
                  <Id>01t4P00000884AHQAY</Id>
                  <Apttus_Config2__Customizable__c>false</Apttus_Config2__Customizable__c>
                  <Apttus_Config2__HasAttributes__c>true</Apttus_Config2__HasAttributes__c>
                  <Apttus_Config2__HasDefaults__c>false</Apttus_Config2__HasDefaults__c>
                  <Apttus_Config2__HasOptions__c>true</Apttus_Config2__HasOptions__c>
                  <Family>CSD Products</Family>
               </Apttus_Config2__ProductId__r>
               <Apttus_Config2__Quantity__c>400.00000</Apttus_Config2__Quantity__c>
               <Apttus_Config2__SellingFrequency__c>Monthly</Apttus_Config2__SellingFrequency__c>
               <Apttus_Config2__SellingTerm__c>12.00000</Apttus_Config2__SellingTerm__c>
               <Apttus_Config2__StartDate__c>2016-06-20</Apttus_Config2__StartDate__c>
               <Name>SecureCloud Enterprise</Name>
            </AssetSearchResultDO:AssetItems>
            <AssetSearchResultDO:AssetItems xsi:type="Apttus_Config2__AssetLineItem__c">
               <Id>a114P000004ie6dQAA</Id>
               <Apttus_Config2__AccountId__c>0014P000028PFFSQA4</Apttus_Config2__AccountId__c>
               <Apttus_Config2__AssetStatus__c>Activated</Apttus_Config2__AssetStatus__c>
               <Apttus_Config2__BasePriceMethod__c>Per Unit</Apttus_Config2__BasePriceMethod__c>
               <Apttus_Config2__BasePrice__c>131328.00000</Apttus_Config2__BasePrice__c>
               <Apttus_Config2__BusinessObjectId__c>a0c4P00000G3AikQAF</Apttus_Config2__BusinessObjectId__c>
               <Apttus_Config2__ChargeType__c>Subscription Fee</Apttus_Config2__ChargeType__c>
               <Apttus_Config2__Description__c>SecureCloud Premier Support</Apttus_Config2__Description__c>
               <Apttus_Config2__EndDate__c>2017-06-19</Apttus_Config2__EndDate__c>
               <Apttus_Config2__Frequency__c>Yearly</Apttus_Config2__Frequency__c>
               <Apttus_Config2__IsPrimaryLine__c>true</Apttus_Config2__IsPrimaryLine__c>
               <Apttus_Config2__IsPrimaryRampLine__c>false</Apttus_Config2__IsPrimaryRampLine__c>
               <Apttus_Config2__IsReadOnly__c>false</Apttus_Config2__IsReadOnly__c>
               <Apttus_Config2__IsUsageTierModifiable__c>false</Apttus_Config2__IsUsageTierModifiable__c>
               <Apttus_Config2__ItemSequence__c>1</Apttus_Config2__ItemSequence__c>
               <Apttus_Config2__LineNumber__c>2</Apttus_Config2__LineNumber__c>
               <Apttus_Config2__LineType__c>Product/Service</Apttus_Config2__LineType__c>
               <Apttus_Config2__MustUpgrade__c>false</Apttus_Config2__MustUpgrade__c>
               <Apttus_Config2__NetPrice__c>131328.00000</Apttus_Config2__NetPrice__c>
               <Apttus_Config2__PriceType__c>Recurring</Apttus_Config2__PriceType__c>
               <Apttus_Config2__ProductId__c>01t4P00000884tTQAQ</Apttus_Config2__ProductId__c>
               <Apttus_Config2__ProductId__r xsi:type="Product2">
                  <Id>01t4P00000884tTQAQ</Id>
                  <Apttus_Config2__Customizable__c>false</Apttus_Config2__Customizable__c>
                  <Apttus_Config2__HasAttributes__c>false</Apttus_Config2__HasAttributes__c>
                  <Apttus_Config2__HasDefaults__c>false</Apttus_Config2__HasDefaults__c>
                  <Apttus_Config2__HasOptions__c>false</Apttus_Config2__HasOptions__c>
                  <Family>CSD Products</Family>
               </Apttus_Config2__ProductId__r>
               <Apttus_Config2__Quantity__c>1.00000</Apttus_Config2__Quantity__c>
               <Apttus_Config2__SellingFrequency__c>Yearly</Apttus_Config2__SellingFrequency__c>
               <Apttus_Config2__SellingTerm__c>1.00000</Apttus_Config2__SellingTerm__c>
               <Apttus_Config2__StartDate__c>2016-06-20</Apttus_Config2__StartDate__c>
               <Name>SecureCloud Premier Support</Name>
            </AssetSearchResultDO:AssetItems>
            <AssetSearchResultDO:AssetItems xsi:type="Apttus_Config2__AssetLineItem__c">
               <Id>a114P000004ie6eQAA</Id>
               <Apttus_Config2__AccountId__c>0014P000028PFFSQA4</Apttus_Config2__AccountId__c>
               <Apttus_Config2__AssetStatus__c>Activated</Apttus_Config2__AssetStatus__c>
               <Apttus_Config2__BasePriceMethod__c>Per Unit</Apttus_Config2__BasePriceMethod__c>
               <Apttus_Config2__BasePrice__c>500.00000</Apttus_Config2__BasePrice__c>
               <Apttus_Config2__BusinessObjectId__c>a0c4P00000G3AikQAF</Apttus_Config2__BusinessObjectId__c>
               <Apttus_Config2__ChargeType__c>Subscription Fee</Apttus_Config2__ChargeType__c>
               <Apttus_Config2__Description__c>SecureTraining Online</Apttus_Config2__Description__c>
               <Apttus_Config2__EndDate__c>2020-06-19</Apttus_Config2__EndDate__c>
               <Apttus_Config2__Frequency__c>Yearly</Apttus_Config2__Frequency__c>
               <Apttus_Config2__IsPrimaryLine__c>true</Apttus_Config2__IsPrimaryLine__c>
               <Apttus_Config2__IsPrimaryRampLine__c>false</Apttus_Config2__IsPrimaryRampLine__c>
               <Apttus_Config2__IsReadOnly__c>false</Apttus_Config2__IsReadOnly__c>
               <Apttus_Config2__IsUsageTierModifiable__c>false</Apttus_Config2__IsUsageTierModifiable__c>
               <Apttus_Config2__ItemSequence__c>1</Apttus_Config2__ItemSequence__c>
               <Apttus_Config2__LineNumber__c>3</Apttus_Config2__LineNumber__c>
               <Apttus_Config2__LineType__c>Product/Service</Apttus_Config2__LineType__c>
               <Apttus_Config2__MustUpgrade__c>false</Apttus_Config2__MustUpgrade__c>
               <Apttus_Config2__NetPrice__c>5000.00000</Apttus_Config2__NetPrice__c>
               <Apttus_Config2__PriceType__c>Recurring</Apttus_Config2__PriceType__c>
               <Apttus_Config2__ProductId__c>01t4P00000884t9QAA</Apttus_Config2__ProductId__c>
               <Apttus_Config2__ProductId__r xsi:type="Product2">
                  <Id>01t4P00000884t9QAA</Id>
                  <Apttus_Config2__Customizable__c>false</Apttus_Config2__Customizable__c>
                  <Apttus_Config2__HasAttributes__c>false</Apttus_Config2__HasAttributes__c>
                  <Apttus_Config2__HasDefaults__c>false</Apttus_Config2__HasDefaults__c>
                  <Apttus_Config2__HasOptions__c>false</Apttus_Config2__HasOptions__c>
                  <Family>CSD Products</Family>
               </Apttus_Config2__ProductId__r>
               <Apttus_Config2__Quantity__c>10.00000</Apttus_Config2__Quantity__c>
               <Apttus_Config2__SellingFrequency__c>Yearly</Apttus_Config2__SellingFrequency__c>
               <Apttus_Config2__SellingTerm__c>1.00000</Apttus_Config2__SellingTerm__c>
               <Apttus_Config2__StartDate__c>2019-06-20</Apttus_Config2__StartDate__c>
               <Name>SecureTraining Online</Name>
            </AssetSearchResultDO:AssetItems>
            <AssetSearchResultDO:HasAssetItems>true</AssetSearchResultDO:HasAssetItems>
         </result>
      </getAssetsForSearchTextResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML