Date: Thu, 28 Mar 2024 07:27:12 -0700 (PDT) Message-ID: <120491539.658.1711636032027@ip-172-30-17-85.ec2.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_657_752120442.1711636031998" ------=_Part_657_752120442.1711636031998 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Executes a query against the specified = table and returns an array of record data for the records that match the sp= ecified criteria.
EWWSBas= eUserObject[] os =3D ew.EWSelectFromTable(String sessionId, String tableName, String whereClause); or for the table-specific call:=20 WSCase[] cases =3D ew.EWCreateAndRead_WSCase(String sessionId, String where= Clause)
Use EWSelectFromTable call to search for records in the specified table.=
The SQL query supplied should only include the "where" clause from a con= struct similar to:
select p= rimary-key-field-name from table-name where ...
When querying records, consider the following rules and guidelines:
Values for the fields that are imported into the target table from the d= onor table as a part of a Linked Fields set are available via special linki= ng classes.
In WSDL a Linked Fields set takes form of DAO_Dao3_Link<N> field i= n the complex data structure that corresponds to the target table, where N = is a sequential number assigned automatically at the time of the set creati= on, such as WSCase.DAO_Dao3_Link3.
As a value such fields can take one or more WS<Table1><Table2&g= t;_Dao3_Link<N> data structures - linking classes, where Table1 is th= e target table and Table2 is the donor table of the Linked Fields relations= hip, such as WSCaseTeams_Dao3_Link3.
Unfortunately, at this moment one has to rely on investigating the actua= l sets of fields inside the classes to trace the fields, visible in the Fie= ld wizard in the GUI, back to the main object property - not visible in the= GUI.
Non-source values for Linked Field sets that allow them are present dire= ctly 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 instance(s) of the enumera= ted types described in the WSDL.
The original text values have undergone the following transformations:= p>
One has to perform the reverse transformation to get to the text value.<= /p>
Related tables and embedded search results are not supported by the SOAP= interface.
Compose the whereClause.
Note: "Prepared" statements are= not supported, all parameters have to be passed inside of the whereClause = string.
Perform the call.
In MyKB knowledgebase, as user A, find all cases assigned to John Doe. R= eturn summaries as a String array.
The task is completed by performing the following steps:
p= ublic String[] select() throws Exception { EWServiceAPI binding =3D new EWServiceAPIServiceLocator().get= Demo(); try { String sessionId =3D binding.EWLogin("MyKB", "A", "password",= "en"); EWWSBaseUserObject[] records =3D binding.EWSelectAndRead(sess= ionId, "case", "assignee=3D'John = Doe'"); String[] result =3D new String[records.length]; for (int i=3D0; i<records.length; i++) { result[i] =3D records[i].getSummary(); } return result; } finally { binding.EWLogout(sessionId); } }
You can generate sample Web Services code for any table by selecti= ng Setup > Tables > [Edit Table] > API > Downloa= d Sample.
Name |
Type |
Description |
---|---|---|
sessionId |
String |
Session token |
tableName |
String |
The name of the table where the query has to = be performed - only for generic methods |
where |
string |
The where clause of the SQL select construct<= /p> |
An array of the records as descendants of EWWSBaseUserObject - a complex= structure described in WSDL.
EWSessionException - client not logged in or sessi= on has expired; client should re-login.
EWPermissionException - user used to create the se= ssion lacks sufficient privileges to run the query.
EWWrongDataException - client has supplied wrong d= ata.
EWOperationException - the operation has been bloc= ked by an Agiloft function, e.g. table-level lock.
EWIntegrityException - specified table cannot be f= ound or its primary key cannot be identified.
EWUnexpectedException - an unexpected exception ha= s happened; the admin user should report this for investigation.