Search This Blog

Saturday, May 11, 2013

Extended "Get" function

Recently we have introduced new feature which is "Reference" field type. So now one case can reference another case. We think it can be useful to get some data from "referenced" case. Therefore "Get" function was extended to support it. Full desctiption of the function is shown below:


Get("table (>table>table...) | reference field","field title","(first|last|row number)")
Returns value of the given field from given row (by default first) of given table or from the case referenced in given field.
Function arguments:
  • "table (>table>table...)" - names of table fields. You can specify nested tables by separating them by ">"
  • "reference field" - name of the field with reference type
  • "field title" - name of the field from table or from referenced case
  • "(first|last|row number)" - (optional) from which row you want to get value. By default system return value from first row. For reference field this parameter is ignored.

Example 1:
Get("Positions","amount");
Positions is the name of table field.
Returns value of amount field from first row of positions table
Example 2:
Get("People","Name",3);
People is the name of table field.
Returns value of Name field from third row of People table. If there are less than 3 rows in this table, system will return value from last row.
You can use CountRows() function to determine how many rows are in this table.
Example 3:
Get("Invoices>Positions","ammount","last");
Invoices and Positions are table fields. Positions table is definied inside Invoices table.
Returns value of ammount field from last row of positions table definied inside invoices table (if there are many invoice rows, system will returns value from last invoice row). 
Example 4:
Get("Customer","Address");
Customer is the name of reference field.
Returns value of Address field from case selected in Customer field.

No comments:

Post a Comment