Customer Searching Rules

There are two scenarios for performing the search.
1. There are no SearchFields provided: ID and ExternalID have priority successively. If ID is provided, the customer will be searched by SAP CPQ ID, and External ID will be ignored. If the value of the ID field is empty, ExternaID will be used for the search.

2. We have two cases if SearchFields are provided, depending on Priority attribute of SearchFields node:

  • Priority = “1”; the search will be performed as a combination of the fields that are provided as search fields. If the search fails (returns none or multiple Customers), the search will be tried again like described in scenario #1.
  • Priority has any other value; first, the search will be tried like described in scenario #1. If search fails, the search will be performed as a combination of the fields that are provided as search fields. If a value for a search field is missing or empty, it will be omitted from search condition.

Search Tips and Tutorials

1. Currently, the SAP CPQ API Customer Administration does not support having more than one custom field in the “search custom field” section. The custom field specified in the search section must be added for each customer in the XML file respective to their custom field list; otherwise, when importing the XML an error message will pop up.

2. Actions delete, update and addupdate work only with a single customer at one given time. If using search parameters we don’t find one distinct customer, or we find more than one, the specified search field is overrun and search parameters are defined by the customer’s ID or ExternalID.

When using this type of search, the first customer that the system finds will be returned by his ID. If the customer is not found, the customer will be searched by his ExternalID. Regardless of values entered in other search fields, the system will return the first customer it finds. If, after completing our search, we still cannot find a single customer, an error message will pop up – except for add action for which the system does not use the search function.

3. To avoid any accidental updates or customer deletes, the search field and parameters should be picked for their respective values so that only a single customer will be affected by these actions. This isn’t as easy because only the SAP CPQ ID is a valid identifier of a single customer. In other words, there is a possibility that a combination of other search fields can return more than one customer.

SoapUI seems to interpret spaces and new line characters a bit differently than other API App so this should be written in the same line as follows: Instead of these lines in XML

                      <CustomFields>
                          <CustomField>
                            <Name>JasonTest</Name>
                            <Value>Hello</Value>
                         </CustomField>
                      </CustomFields>

add

<CustomFields><CustomField><Name>JasonTest</Name><Value>Hello</Value></CustomField></CustomFields>

* all in one line with no spaces

You are here: SAP Sales Cloud CPQ Online HelpSAP CPQ APICustomer Administration Web MethodCustomer Searching Rules