Using the PaginationSearch Web Method

This web method retrieves one or more business objects based on the search criteria. This is a Microsoft SQL style query. Compared to the other search web methods, you can use this general-purpose web method to express arbitrarily complex queries.

Request Syntax

FRSHEATIntegrationSearchResponse PaginationSearch(string sessionKey, string tenantId, ObjectQueryDefinition query, int skip)

Parameters

sessionKey: The session key from the Connect web method.

tenantId: The tenant for which the session key is authenticated.

query: A structure describing the search criteria. It follows the structure of a Microsoft SQL Select request and captures most of the possible parameters in Select queries, including Top, Where, Join, and Order By clauses. In PaginationSearch method, the Top value is considered as the page size parameter. If Top is not specified, then this method returns 100 records by default.

skip : Integer value which indicates the number of records that need to be skipped from top of the result set (that is, similar to offset parameter).

Return Value

FRSHEATIntegrationSearchResponse object, defined as follows:

public class FRSHEATIntegrationSearchResponse

    {

public string status { get; set; }

public string exceptionReason { get; set; }

public List<List<WebServiceBusinessObject>> objList { get; set; }

    }

The FRSHEATIntegrationSearchResponse class has the following fields:

status: Provides a status value indicating whether the operation was successful. A full description of the available status values is provided in the table below.

exceptionReason: Contains exception information, if the system throws an exception when running the Connect web method.

objList: Contains a list of the results found, if the value of the status field is success. The outer list contains multiple business objects, if the search condition matched more than one business object. The inner list contains joined business objects, if the search condition requested joins. Unlike Microsoft SQL response, fields from each joined objects are kept in a separate list. They are not mingled together. If you do not specify the Top value in the request, then objList will return top 100 records from the result list by default.

The below table lists the available status values and describes how to interpret them.

Status

Description

Success

Successfully found the business objects. Access the business object list from the objList field, which returns the results as a list of WebServiceBusinessObjects.

Error

Cannot find the business objects. The objList field is null. Inspect the corresponding exceptionReason field to determine why the web method failed.

Following are the common error examples:

A typical error is Table not found, which occurs when the specified business object does not exist in the tenant.

Ensure that the name of the business object is spelled properly.

Another common error is that the specified field does not exist for the business object. The error message is:

ObjectTableMap: field <FieldName> is not found in table <Business Object>#

Ensure that the field name is spelled correctly and defined for the specified business object.

NotFound

The specified business object exists in the tenant, but the specified RecID does not match any of the existing records in the object.

Since this is not an exceptional condition, no exception is stored in the exceptionReason field but the objList field is null. Ensure that the RecID for the intended record exists in the tenant.

You can set the default Top maximum value using the Appserver webconfig property.
<add key="DefaultMaxNumberOfRecordsRestAPI" value="100" />

If you specify the Top value as 0, then the PaginationSearch method will return 100 records by default.