GetList

Previous  Home topic  Next  Print this topic Send Feedback

The GetList method retrieves a list of fields from the form in a table format.

 

int GetList (string tokenIn, string[ ] fields, string where, out string tokenOut, out Datatable table)

 

 

Send Params

Return Params

fields - This is an array of form field IDs that you want to retrieve from the API. The name of the field respects the naming conventions from the SDK and should be fully qualified names. So if the control on the form is named 'First Name' and is placed inside a page called 'Page 1' its qualified name will be 'Page 1|First Name' and the field name should be 'Page_1_First_Name'. The basic rule for converting control names to fields name is replacing each character that is not a name or a letter with '_' (underscore).

Additional examples of controls placed in a page called „Page 1”:

oControl name: 'Date of birth' -> Field name: „Page_1_Date_of_birth'
oControl name: 'Date (MM/dd/yy)' -> Field name: „Page_1_Date__MM_dd_yy_'
oControl name: 'Strange!@#$%^&*()_+{}|[]' -> Field name: „Page_1_Strange_________________'
oControl name: 'Text 1” -> Field name: 'Page_1_Text_1'

Some controls acts as containers so you can place more controls inside. The full name for a text box 'Text 1' placed in a Group or Container 'Group 1' situated in 'Page 1' will be 'Page_1_Container_1_Text_1'.


Note: When using the fields parameter, the form instance ID will always be included in the resulting table.


 

tokenIn - This is the security token that is obtained by the previous API call. See the API Security topic for more details.

 

where - This parameter specifies a where clause to be used as if it were a regular database WHERE clause. It uses a regular SQL syntax.

Sample where clause:

oFirst_Name like 'John%' and Amount>10

At the time of writing, this is not fully implemented so an empty string should be used.

table - This contains the returned data list.
tokenOut - This is the new security token that should be used for the next Web service call after this one. See the API Security topic for more details.

 

 

 

Sample Code

 

private void ButtonGetList_Click(object sender, EventArgs e)

{

 PerfectForms.FirstTestService service;//declare

 service = new SDKTest1.PerfectForms.FirstTestService();//instantiate

 string tokenIn = "jAgAgEgAggAAAgwA";

 string[] fields = new string[0];

 string where = string.Empty;

 string tokenOut;

 DataTable table;

 int errorCode;

 errorCode = service.GetList(tokenIn, fields, where, out tokenOut, out table);

 if (errorCode == 0)

 {

         MessageBox.Show("I retrieved a list of " + table.Rows.Count + " instances!");

 }

 else

 

         MessageBox.Show("Error " + errorCode.ToString() + " encountered!");

 }

}

 

 

Updated: 06/12/2011  Page url: http://www.perfectforms.com/Documentation/manual/html/?getlist.htm
PerfectForms™ -- forms software, workflow software, and business process management