Executes a pre-configured named Saved Search against the specified table and returns and array of record data for the records that match the search. This operation variant allows iteration through results page by page, also called pagination.
EWWSBaseUserObject[] os = ew.EWSearchTablePaginated(String sessionId, String tableName, String[] fieldNames, String searchName, int page, int limit); |
Use the EWSearchTablePaginated call to search for records in the specified table based on a Saved Search pre-configured in the GUI. Specify page and limit parameters to retrieve data page by page.
When querying records, consider the following rules and guidelines:
nillable="true"
, means the actual null value was retrieved. However, the rest of the fields – those not listed in the fieldNames array – will also appear on the wire as nillable="true"
elements due to limitations of the underlying Web Services stack.Values for the fields that are imported into the target table from the donor table as a part of a Linked Fields set are available via special linking classes.
In WSDL a Linked Fields set takes form of a DAO_Dao3_Link field in the complex data structure that corresponds to the target table, where N is a sequential number assigned automatically at the time of the set creation, for example WSCase.DAO_Dao3_Link3.
As a value such fields can take one or more WS_Dao3_Link data structures - linking classes, where Table1 is the target table and Table2 is the donor table of the Linked Fields relationship, for example WSCaseTeams_Dao3_Link3.
Unfortunately, at this moment one has to rely on investigating the actual sets of fields inside the classes to trace the fields, which are visible in the Field wizard in the GUI, back to the main object property, which is not visible in the GUI.
Non-source values for Linked Field sets that allow them are present directly in the table itself and additionally to those in the Linking Classes, if the link was in fact forged.
The values for choice columns are returned as instances of the enumerated types described in the WSDL.
The original text values have undergone the following transformations:
Perform the reverse transformation to get to the text value.
Embedded search results are not supported by the SOAP interface.
In MyKB knowledgebase, as user A, find all cases assigned to the user used to login. Return the first 40 summaries as two String arrays, up to 20 elements each.
The task is completed by performing the following steps:
You can generate sample Web Services code for any table by selecting Setup > Tables > [Edit Table] > API > Download Sample.
public String[][] search() throws Exception { EWServiceAPI binding = new EWServiceAPIServiceLocator().getDemo() try { String sessionId = binding.EWLogin("MyKB", "A", "password", "en"); String[][] result = new String[2][]; EWWSBaseUserObject[] records1 = binding.EWSearchTablePaginated(sessionId, "case", new String[] {"summary"}, "My Assigned", 0, 20); result[0] = new String[records1.length]; for (int i=0; i<records1.length; i++) { result[0][i] = records1[i].getSummary(); } EWWSBaseUserObject[] records2 = binding.EWSearchTablePaginated(sessionId, "case", new String[] {"summary"}, "My Assigned", 1, 20); result[1] = new String[records2.length]; for (int j=0; j<records2.length; j++) { result[1][j] = records2[j].getSummary(); } return result; } finally { binding.EWLogout(sessionId); } } |
Name | Type | Description |
---|---|---|
sessionId | String | Session token. |
tableName | String | The name of the table where the query has to be performed. |
fields | String array | The list of fields to read. |
searchName | String | The name of the Saved Search to run. |
page | int | The page number. |
limit | int | The records per page limit, or page size. |
An array of the records as descendants of EWWSBaseUserObject - a complex structure described in WSDL.
EWSessionException - client not logged in or the session has expired; client should re-login.
EWPermissionException - user used to create the session lacks the sufficient privileges to run the query.
EWWrongDataException - client has supplied the wrong data.
EWOperationException - the operation has been blocked by an function, for example a table-level lock.
EWIntegrityException - specified table cannot be found or its primary key cannot be identified.
EWUnexpectedException - an unexpected exception has occurred; the admin user should report this for investigation.
Related articles |