searchProductsCount
Search the product database, only return number of products matched
Description
Identical to the searchProducts method except only the product counts are returned. Like searchProducts, this method returns ProductSearchResult. The only difference is that ProductSearchResult.Products is left empty. This method provides a quicker way to determine the size of the result set before starting to retrieve the full search results.
See also searchProducts, searchProductsCustom
Syntax
ProductSearchResult searchProductsCount ( ueSecurityToken Token, SearchParam Search, boolean MatchAll, integer Start, integer Limit, string Sort)
Arguments
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and validate transaction. |
SearchParam | Search | Array of search parameters (SearchParam objects) available. |
boolean | MatchAll | If set to "true," only results matching all search criteria will be returned, if set to "false," results matching any of the search criteria will be returned. |
integer | Start | Sequence number to start returning on. |
integer | Limit | Maximum number of transactions to return in result set. |
string | Sort | Comma separated list of fields to sort by. |
Return Value
| Type | Description |
| ---- | ---- | -----------
| ProductSearchResult | Returns full products records for all products matching the specified search parameters. |
Examples
.NET VB
Dim MatchAll As Boolean
MatchAll = False
Dim searchParams(1) As newtek.SearchParam
searchParams(0) = New newtek.SearchParam
searchParams(0).Field = "Created"
searchParams(0).Type = "gt"
searchParams(0).Value = "2010-09-07"
Dim SearchResults As newtek.ProductSearchResult = New newtek.ProductSearchResult
SearchResults = client.searchProductsCount(token, searchParams, MatchAll, 0, 1000, "created")
MsgBox(SearchResults.ProductsMatched)
.NET C
newtek.SearchParam[] param = new newtek.SearchParam[1];
param[0] = new newtek.SearchParam();
param[0].Field = "Created";
param[0].Type = "Contains";
param[0].Value = "2010-08-12";
Boolean matchAll = true;
string start = "0";
string limit = "10";
string sort = "created";
newtek.ProductSearchResult response = new newtek.ProductSearchResult();
try
{
response = client.searchProductsCount(token, param, matchAll, start, limit, sort);
MessageBox.Show(string.Concat(response.ProductsMatched));
}
catch (Exception err)
{
MessageBox.Show(err.Message);
}
Change History
Version | Change |
---|---|
1.3 | Function added in 1.3 release |