FPL Script Command Syntax
Arithmetic
calculations and rounding
Date and Time field arithmetic
set
column displayonly/hidden/mandatory
set
field displayonly/hidden/mandatory/hyperlink
set
group displayonly/hidden/mandatory
unset
column displayonly/hidden/mandatory
unset
field displayonly/hidden/mandatory/hyperlink
unset
group displayonly/hidden/mandatory
$SYSTEM_PREFERENCES_USE_JAVASCRIPT
$SYSTEM_PREFERENCES_USE_POPUPS
$SYSTEM_PREFERENCES_OPTION_COLOUR_BUTTON
$SYSTEM_PREFERENCES_OPTION_ZOOM_BUTTON
See also: Custom functions
· Each command statement must be terminated by a semi-colon with the exception of the if/else/endif and loop/endloop statements
· Literal values should be enclosed within single quotes
· The script editor contains a verify function (available from the Script menu) which can be used to check syntax
· A script command that generates an error at runtime will result in the display of the Ebase error page showing the error. Additional information on the error and on the behaviour of scripts can be found by adjusting the logging level (see Runtime parameters)
· The script editor contains dropdowns showing shortened versions of the syntax of commands and functions
· Comments may be inserted anywhere in a script. A comment starts with //. The rest of the line is ignored
·
Two types of expressions are supported:
Syntax:
Conditional expressions are used in if statements and loop statements and are the combination of any form field, constant, system or user defined function, with supported unary, boolean and conditional operators. A conditional expression returns a TRUE or FALSE value.
Supported unary operators are +, -, /, * denoting addition, subtraction, division and multiplication respectively.
Supported conditional operators are >, <, >=, <=, =, != denoting greater than, less than, greater than or equal, less than or equal, equal and not equal to respectively.
Supported boolean operators are AND, OR, and ! denoting boolean AND, OR and NOT respectively.
Examples:
if [ F1 > 1 ]
if [ F1 > F2 + F3 + 100]
if [ (F1 + F2) = (F3 - F4) ]
if [ F2 != (F2 * F3) ]
if [ !(F2 = F3) ]
if [ ( ( repayment (F1,F2+F3) > 100 or ( (F1 < F2 - 1000) and F3 != F4/F5) ) ) or F2 = 'A' ) ]
loop [ COUNTER >= 100 ]
Syntax:
Value expressions are used in set field commands and may be any form field, constant, system or user defined function, in combination with supported unary operators, that returns a numeric, character or date value.
Supported unary operators are +, -, /, * denoting addition, subtraction, division and multiplication.
Examples:
set F1 = 100;
set F1 = F2 + F3 - 200;
set F4 = uppercase( F10 + 'B');
set F1 = round ( ( F2 + getquote ( F1,repayment(F2*F3) ) ) - (F3 - 100)*(F3+F4) );
set F2 = '31/12/1981' + 50;
Ebase is capable of performing arithmetic calculations with a great degree of accuracy. Each numeric or currency field can hold up to 17 significant digits including decimal places. Values with more than 17 significant digits will be rounded.
It is important to note that Ebase rounds numeric values each time a value is assigned to a field. The rounding depends on the number of decimal places and the rounding algorithm specified for the target field. For example, the statement:
set F1 = 1.23745;
Will produce different results depending on the number of decimal places declared for the target field F1:
|
1.24 |
(2 decimal places) |
|
1.237 |
(3 decimal places) |
|
1.2375 |
(4 decimal places) |
|
1.23745 |
(5 decimal places) |
Because rounding is applied each time a value is assigned to an Ebase field, it can be important to pay close attention to the number of decimal places and also the number of statements used for a calculation. e.g. if F1 is declared with 2 decimal places, the statement:
set F1 = 9.3283 * 1.478431 / 100;
Produces the correct result: 0.14.
However if this is coded as 2 statements:
set F1 = 9.3283 / 100;
set F1 = F1 * 1.478431;
The result is 0.13 as the rounding algorithm has been applied twice.
For arithmetic operations applied to fields of type DATE, numeric constants are taken to represent a number of days e.g.
set F1 = '01/04/2002' + 10;
will set the F1 field equal to 11/04/2002.
For arithmetic operations applied to fields of type TIME or DATETIME, numeric constants are taken to represent a number of seconds e.g.
set TIME1 = TIME1 + (30 * 60);
will add 30 minutes to field TIME1.
All date literals entered in scripts (e.g. example above under Date Arithmetic) or as default values must be entered in the format defined for the Ufs.dateFormat parameter in the UFSSetup properties file. e.g. for date format mm.dd.yyyy, an appropriate statement to set a date value would be:
set MY_DATE_FIELD = '02.29.2004';
and for date format dd/mm/yyyy, it would be:
set MY_DATE_FIELD = '29/02/2004';
Time literals entered in scripts or as default values can be entered as either HH:MM, HH:MM:SS or HH:MM:SS.TTT. e.g.
set MY_TIME_FIELD = '10:49:22';
Datetime literals entered in scripts or as default values can be entered by combining the formats shown above for date and time literals. e.g.
set MY_DATETIME_FIELD = '29/02/2004 10:49:22';
Environment variables are variables that are defined externally. These can be very useful for defining things that vary with each server instance e.g. a file path or external URL. Environment variables can be included in FPL statements – see using environment variables for more information.
A number of read-only properties of tables and fields can be accessed using syntax fieldname.propertyname. e.g.
if [ EMP_TABLE.rowcount > 0 ]
…
endif
set xxx
= f1.presentationType;
set xxx
= f2.valuelength;
These property expressions can be used at any point in FPL where a field can be used. The properties are not case sensitive i.e. T1.ROWCOUNT, t1.rowcount, t1.rowCount can all be used.
The following table properties are available:
|
Property |
Description |
|
rowCount |
The number of rows in the table. |
See also the set table command for additional table properties that can be set.
The following field properties are available:
|
Property |
Description |
|
name |
Field name |
|
type |
Field type. This will be one of the following: BOOLEAN CURRENCY DATE DATETIME INTEGER NUMERIC TIME |
|
presentationType |
Field presentation type. This will be one of the following: BUTTON LABEL PASSWORD RADIO SELECT (Dropdown list) TEXT TEXTAREA |
|
maximumLength |
Maximum number of characters that can be entered |
|
valueLength |
Length of the current value |
|
formattedValue |
Returns the value for the field
formatted according to the formatting language in use for the form. For
numeric fields, formatting commas are included. Date and time fields are
presented in the same format as seen by the end user running the form |
|
unformattedValue |
Returns the value for the field. For numeric fields, any formatting commas are removed and the decimal point i.e. comma or point, will be taken from the formatting language used for the system’s default language. For date fields, the value returned is in the format defined in UFSSetup.properties parameter Ufs.dateFormat. |
The system variable $COMMAND_STATUS contains the status of the previously executed script command and can be queried. The value 'OK' indicates successful execution for all commands. The error statuses that can be returned are listed under the commands below. This example shows querying the feedback from a lock command and notifying the user that a resource is not available:
lock 'MATERIAL' MATERIAL_ID;
if [ $COMMAND_STATUS = 'ERROR' ]
message E,1234, MATERIAL_ID;
endif
|
Syntax: |
|
|
|
|
|
Description: |
aborts execution of the current form and rolls back the current transaction. If an on error event is specified for the form, this will receive control. Otherwise the default system abort page is displayed.
System variable $ABORT_MESSAGE is set with the abort reason supplied in expression. System variable $ABORT_PAGE is set with the current page or null if there is no current page e.g. when running a before or after form event. |
|
|
|
|
Examples: |
abort; abort
'Access denied to payroll data'; abort 'Error occurred: ' + ERROR_DETAIL; |
|
$COMMAND_STATUS: |
Not applicable |
|
Syntax: |
break;
This command can only be coded between loop and endloop statements |
|
|
|
|
Description: |
immediately stops execution of the current loop and proceeds with execution of the first statement following the endloop. If loop statements are nested, the break statement applies to the loop at the same level as the break statement |
|
|
|
|
Examples: |
loop
at table EXPENSES set COUNTER = 0; loop set COUNTER = COUNTER + 1; if [ COUNTER > 1000 ] log 'Breaking inner loop'; break; endif endloop endloop |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
call RESOURCE [ ( component_prefix ) [ BINDING ]; component_prefix is the name of the component prefix where the command is directed to a resource in a component business view RESOURCE is the name of a custom resource, or the name of a form field containing a resource name. BINDING is optional |
|
|
|
|
Description: |
Used to call a web service when BINDING can be specified as a form field. If BINDING is a literal, it should be enclosed in quotes. |
|
|
|
|
Examples: |
call
CLIENT_CHECK; call
FLIGHTS_WS 'LOG'; call
SETDATE ( COMP1 ); |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
|
ERROR |
- see Web Services Adapter for details |
|
|
NOT_FOUND |
- the specified adapter was not found |
|
Syntax: |
callscript SCRIPTNAME; callscript expression; SCRIPTNAME is the name of the script to be called expression can be a literal value, another form field, an arithmetic expression, a function call, or any combination of these (see expressions), that when evaluated is treated as a script name.
See also return. |
|
|
|
|
Description: |
The CALLSCRIPT command passes processing control to the named FPL script. The called script may return control to the calling script by issuing the return command. On return from the called script, normal form processing is resumed from the point where the CALLSCRIPT command was executed i.e. the FPL command following the CALL will be executed if there is one, or the next script in the sequence will be executed etc.
Ebase does not support the recursive calling of scripts. If a recursive call is detected then an error message will be displayed with the message:
'Script SCRIPTNAME: Recursive scripts detected' |
|
|
|
|
Examples: |
callscript ADD_TO_TOTAL; callscript 'ADD' + '_TO' + '_TOTAL; set
VAR1 = 'ADD_TO_TOTAL'; callscript VAR1; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
|
NOT FOUND |
- the script could not be found |
|
Syntax: |
call url [ GET | POST ] expression [,parm1=value1, parm2=value2.......];
GET or POST are optional and specify the
HTTP method to be used for the call. If omitted,
the default is GET. Please note that when POST is specified, the system
writes an additional HTML page to the browser to invoke the specified URL;
this page is added to the browser’s history cache and interferes with the
operation of the browser
back button.
The result is that the user will not be able to use the back button to
navigate back from the called URL to the Ebase form. For this reason, it is
recommended that POST is only used when there is no alternative, or for forms
which do not support the back button. expression can be a literal value, another form field, an arithmetic expression, a function call, or any combination of these (see expressions), that when resolved is treated as a URL. If an external URL is called, the full name including the protocol (e.g. http://) must be specified.
parm1, parm2... are the names of form fields in the called form which will receive the passed values value1, value2... can be either a quoted value, a numeric value or a form field |
|
|
|
|
Description: |
suspends execution of the current form, committing the current transaction, and calls the specified URL. This command expects the called URL application to subsequently return to Ebase. The called application can also set any Ebase form field values on return by adding them to the return URL.
If the URL represented by expression might contain parameters which are not valid within a URL e.g. whitespace, ?, & etc, then these should be escaped using the urlencode function – see examples below. Note that values passed as parameters value1, value2 etc should not be escaped as this is done automatically by the system. The return URL should invoke the ufsreturn servlet and include the Ebase form session id parameter esessionid i.e. the URL should be of the type domain/ufs/ufsreturn?esessionid=xxxx e.g. http://mydomain/ufs/ufsreturn?essesionid=DF5023C82F8475CDC2909CF739B162AF_5. The full return URL is supplied by the system in system variable $UFS_RETURN_URL and can be passed to the called application if required as shown in the example below. The return URL is also added automatically by the system as parameter ufsReturnURL. Additional Ebase form fields can be added to the return URL to pass status information back to the Ebase form if required. The return call can be made using either HTTP GET or POST. Care should be taken to ensure that the domain name (or host name or ip address) used on the return URL is the same as the one used to initially invoke the Ebase form. If these domain names are different, an error page will be displayed with the message:
'The request has timed out - please try again'
On return, the esessionid
parameter is used to load the appropriate form context and execution of this
form is resumed from the point where the CALL command was executed. i.e. the FPL command following the CALL will be executed
if there is one, or the next script in the sequence will be executed etc. If
the esessionid parameter is not supplied on
the return URL, the most recent form context will be used. |
|
|
|
|
Examples: |
call
url post PAYMENT_SYSTEM_URL, cardId=CREDIT_CARD_NO,
amount=DEBIT_TOTAL; call
url 'http://external.application/calledProg',
parm1=F1, return=$UFS_RETURN_URL; //
parameters passed separately call
url 'http://external.application/calledProg?parm1='
+ F1 + '&returnurl=' + urlencode($UFS_RETURN_URL);
// parameters in expression
Return URL example: http://www.myco.com/ufs/ufsreturn?esessionid=DF5023C82F8475CDC2909CF739B162AF_3&STATUS=OK&INFO_MESSAGE=Message150 |
|
|
|
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
call form FORMNAME [parm1=value1, parm2=value2.......]; call form expression [parm1=value1, parm2=value2.......]; FORMNAME is the name of the form to be called expression is a form field name containing the name of the form to be called as shown in the second example below. parm1, parm2... are the names of form fields in the called form which will receive the passed values value1, value2... can be either a quoted value or a form field
See also returnfrom form and goto form |
|
|
|
|
Description: |
suspends execution of the current form, committing the current transaction, and begins execution of the new form.
This command provides the ability to call another Ebase form and then return to the calling form using the returnfrom form command. Field values can be passed as parameters to the called form and can also be returned from the called form by setting the "return field" property of the fields on the called form. A return parameter must have the same name in both the calling and called forms.
On return from the called form, normal form processing is resumed from the point where the CALL command was executed. i.e. the FPL command following the CALL will be executed if there is one, or the next script in the event sequence will be executed etc. Note: When a 'call form' command is within an IF statement, and then processing returns to the originating form later on, the resume point will not be found if the IF condition is no longer true; for example, if the field value in the IF condition has changed due to the parameters being passed back from the called URL. |
|
|
|
|
Examples: |
call
form PRODUCT_DETAIL PRODUCT_ID=PRODUCT_ID,NEWITEM='Y';
if [
..... ]
set TARGET_FORM = 'NEWFORM1'; else
set TARGET_FORM = 'NEWFORM2'; endif call form TARGET_FORM; To return: returnfrom form; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
commit;
This command has no operands. |
|
|
|
|
Description: |
Commits the current transaction. A new transaction is then started to handle any additional processing. Execution continues with the next FPL statement. See transaction support for more details. |
|
|
|
|
Examples: |
commit; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
|
|
|
|
|
Description: |
copies the contents of the source table to the target table. Any existing data is removed from the target table prior to the copy. Empty rows in the source table are ignored. Any rows in the source table that have been deleted using the deleterow command are ignored All other rows are copied.
All columns having the same name in each table are copied e.g. if T1 has columns T1-A, T1-B, T1-C, T1-D and T2 has columns T2-B, T2-C, T2-X, T2-Y, a copytable from T1 to T2 will copy columns T1-B to T2-B and T1-C to T2-C. Any other columns in T2 will be set to null or the column’s default value.
The current row of the source table is not effected by the copy operation. The current row of the target table is set to the first row after the copy.
See table concepts and capabilities for more information. |
|
|
|
|
Examples: |
copytable T1 to T2; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
delete RESOURCE [ ( component_prefix ) [ BINDING ] ; component_prefix is the name of the component prefix where the command is directed to a resource in a component business view RESOURCE is the name of a database or custom resource, or the name of a form field containing a resource name. BINDING is optional and is applicable only for custom resources |
|
|
|
|
Description: |
deletes one or more rows from the database. The generated SQL statement will include the WHERE clause defined in the database resource and this will constrain which row(s) are deleted. If the WHERE clause is absent, the command is ignored (otherwise all records in the table would be deleted). If any of the resource fields are marked as required but have no value when this command is issued, the form terminates with an appropriate message. |
|
|
|
|
Examples: |
delete
APPLICATION; call
APPLICATION ( COMP1 ); |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
|
ERROR |
- the WHERE clause is absent |
|
Syntax: |
deleterow; |
|
|
|
|
Description: |
deletes the current row from the current table. If the table is backed by an external resource such as a database, the row will be deleted from this resource when a subsequent updatetable command is issued. Note that a table row deleted with the deleterow command is not displayed to the user with the delete flag set, so the user does not have the option to 'undelete'. This is in contrast to deletion requested by the user.
See table concepts and capabilities for more information. |
|
|
|
|
Examples: |
loop at table EXPENSES if
[ AMOUNT = 0 ]
deleterow; endif endloop |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
display expression;
expression can be a literal value, another form field, an arithmetic expression, a function call, or any combination of these (see expressions), that when resolved is treated as a URL. |
|
|
|
|
Description: |
the URL resulting from the evaluation of expression is displayed in a pop-up browser window. This command can be used to pop up another web page or can be used to display any document which can be displayed by the browser, e.g. documents of type doc, xls, pdf, tif, etc. If an external URL is displayed, the full name including the protocol must be specified, (e.g. http://).
Note that this command can be used only when a page of the form is also displayed. For example, it cannot be used in an end of form event or an end of page event for the last page of the form. |
|
|
|
|
Examples: |
display 'http://www.google.com'; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
exec RESOURCE [ ( component_prefix ) [ BINDING ]; component_prefix is the name of the component prefix where the command is directed to a resource in a component business view RESOURCE is the name of a stored procedure or custom resource, or the name of a form field containing a resource name. BINDING is optional and is applicable only for custom resources |
|
|
|
|
Description: |
invokes the stored procedure or function specified by the stored procedure resource. This command is used for all stored procedure resources regardless of their function e.g. input, update, query etc.
The optional component_prefix is used to direct a command from a form level event to a resource within a component business view. See component concepts for more details. |
|
|
|
|
Examples: |
exec
CLIENT_CHECK; exec
CLIENT_CHECK ( COMP1 ); |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
fetch [ RESOURCE [ ( component_prefix ) ] ] [ BINDING ]; component_prefix is the name of the component prefix where the command is directed to a resource in a component business view RESOURCE is the name of a database or custom resource, or the name of a form field containing a resource name. BINDING is optional and is applicable only for custom resources |
|
|
|
|
Description: |
retrieves a single row from the database resource and sets the value of all mapped form fields. If RESOURCE is omitted, the fetch command will be issued to all database resources in the business view associated with the form in the order specified in the business view.
The optional component_prefix is used to direct a command from a form level event to a resource within a component business view. See component concepts for more details.
It is important to realize that this command can only return a single database row to the calling form. If multiple rows are returned by the database, the last row retrieved will be returned to the form. Furthermore, if any of the resource fields are marked as required but have no value when this command is issued, the form terminates with an appropriate message. |
|
|
|
|
Examples: |
fetch
PRICE_DETAIL; fetch
ORDER ( DELIVERY_ORDER ); fetch; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully or command ignored as the WHERE clause is absent |
|
Syntax: |
fetchtable TABLE;
TABLE is the name of a table in the form. |
|
|
|
|
Description: |
loads data into the table from the external resource specified as the backing resource for the table. Typically the external resource will return multiple records which are then displayed to the end user or used for application purposes.
See table concepts and capabilities for more information.
$FETCH_COUNT contains the number of records returned by the external resource after issuing fetchtable |
|
|
|
|
Examples: |
fetchtable
CUSTOMERS; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
goto page PAGENAME;
PAGENAME is the name of the new page expression can only consist of a single form field name as shown in the second example below. |
|
|
|
|
Description: |
goes immediately to the specified page and terminates the event currently being executed i.e. script commands beyond the GOTO PAGE command will not be executed. See page navigation for more details. |
|
|
|
|
Examples: |
goto
page ITEM_DETAIL; set PAGE_FLAG = 'ITEM_DETAIL'; goto page PAGE_FLAG; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
goto url [ GET | POST ] expression [,parm1=value1, parm2=value2.......];
GET or POST are optional and specify the HTTP method to be used for the call. If omitted, the default is GET.
expression can be a literal value, another form field, an arithmetic expression, a function call, or any combination of these (see expressions), that when resolved is treated as a URL. If an external URL is called, the full name including the protocol (e.g. http://) must be specified.
parm1, parm2... are the names of form fields in the called form which will receive the passed values value1, value2... can be either a quoted value, a numeric value or a form field See also call URL which supports calling an external URL and returning to the same form, and display. |
|
|
|
|
Description: |
terminates execution of the current form, committing the current transaction, and passes control to the specified URL. The form memory is freed, and return to the Ebase form is not possible. Navigation back to the form using the browser back button is not possible. If the URL represented by expression might contain parameters which are not valid within a URL e.g. whitespace, ?, & etc, then these should be escaped using the urlencode function. Note that values passed as parameters value1, value2 etc should not be escaped as this is done automatically by the system. |
|
|
|
|
Examples: |
goto url 'homepage.html'; goto url post 'http://uk.box.mail.com/ShowFolder',
name=F1, status='OK'; goto url 'http://uk.box.mail.com/ShowFolder?name='
+ F1 + '&status=OK'; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
hide column COLUMNNAME [ in ] table TABLENAME [ on PAGENAME];
COLUMNNAME is the full name of any column in the table including the table prefix e.g. MYTAB-NAME TABLENAME is the name of the table PAGENAME is the name of the page containing the table
if on PAGENAME is omitted, the table is assumed to be on the current page |
|
|
|
|
Description: |
makes the specified table column invisible. This command is equivalent to: set column COLUMNNAME [ in ] TABLENAME [ on PAGENAME] HIDDEN
This command cannot be issued from a table cell event or within a loop at table construct.
(see show column command for the reverse process) |
|
|
|
|
Examples: |
hide column EMPLOYEES-SALARY in table
EMPLOYEES; hide column SALES-VAT table SALES on
DETAILS; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
hide FIELDNAME [ : id ] ] [ [ in ] table TABLENAME ] [ on PAGENAME];
FIELDNAME is the name of any field in the form PAGENAME is the name of the page containing the field Id is the numerical field identifier. If field FIELDNAME appears more than once on the specified page, the id is used to identify the specific occurrence. If not specified, the first field on the page named FIELDNAME is used.
if on PAGENAME is omitted, the field is assumed to be on the current page in table TABLENAME can be omitted where a table context exists e.g. inside a loop at table construct. |
|
|
|
|
Description: |
makes the specified field invisible on the specified page. If the specified field is a table cell, the command results in the contents of the cell being hidden. This command performs the same function as command: set FIELDNAME [ on PAGENAME] HIDDEN
(see the show command for the reverse process) |
|
|
|
|
Examples: |
hide FIELD_1; hide FIELD_2 on LAST_PAGE; hide DUPLICATED_FIELD : 120; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
hide group GROUPNAME [ on PAGENAME]; GROUPNAME is the name of any group on the specified page PAGENAME is the name of the page containing the group
if on PAGENAME is omitted, the group is assumed to be on the current page |
|
|
|
|
Description: |
makes all fields in the specified group invisible on the specified page. This command performs the same function as command: set group GROUPNAME [ on PAGENAME] HIDDEN
(see the show group command for the reverse process) |
|
|
|
|
Examples: |
hide group G1; hide group G2 on PAGE_9; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
highlight FIELD FIELDNAME [ : id ] [ on PAGENAME ] STYLE; highlight ROW STYLE; highlight TABLECELL COLUMNNAME STYLE;
FIELDNAME is the name of any field in the form PAGENAME is the name of the page containing the field. If omitted, the field is assumed to be on the current page Id is the numerical field identifier. If field FIELDNAME appears more than once on the specified page, the id is used to identify the specific occurrence. If not specified, the first field on the page named FIELDNAME is used. COLUMNNAME is the name of any column in the current table STYLE is the name of the highlighting style to be applied |
|
|
|
|
Description: |
applies the specified presentation highlighting style to the specified field, table row or individual table cell. The highlight row and highlight tablecell commands are interpreted as applying to the current table and these commands can only be issued when a table context applies i.e. within a loop at table....endloop construct or when processing a before or after event for a table or table cell. The unhighlight command can be used to remove a highlight.
See working with presentation templates for information on creating and maintaining highlighting styles. |
|
|
|
|
Examples: |
highlight field FIELD_1 WARNING; highlight field FIELD_2 on LAST_PAGE
WARNING; highlight field DUPLICATED_FIELD : 120 ALERT; highlight row RED; highlight tablecell
T-COL1 BOLD; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
commands; else commands; endif |
|
|
|
|
|
expression is any expression that returns true or false (see expressions)
|
|
|
· The else clause is optional ·
Each if statement must be terminated by
an endif · Any number of commands can be inserted into the if and else clauses ·
if statements can be nested to any
level |
|
|
|
|
Description: |
basic statement for programmed branch logic |
|
|
|
|
Examples: |
if [ SELECTION = 'NEW' ] command1; command2; else command3; endif |
|
$COMMAND_STATUS: |
Not applicable |
|
Syntax: |
insert RESOURCE [ ( component_prefix ) [ BINDING ]; RESOURCE is the name of a database or custom resource, or the name of a form field containing a resource name. BINDING is optional and is applicable only for custom resources |
|
|
|
|
Description: |
inserts a single row into the database. Column values are assigned from the mapped form fields. If any of the resource fields are marked as required but have no value when this command is issued, the form terminates with an appropriate message. |
|
|
|
|
Examples: |
insert
APPLICATION; sequence
APPLICATIONS; set
APPLICATION_ID = $NEXT_SEQUENCE_ID; insert
APPLICATION; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
insertrow TABLE [ EMPTY ];
EMPTY indicates that the new row should be treated as empty until the user inserts data into at least one field. Empty rows are ignored by the updatetable command. (See table concepts and capabilities for more information) |
|
|
|
|
Description: |
inserts a new row into the named table. The fields in the row are initialized with their default values or null as appropriate. Issuing an insertrow command results in the currrent row pointer for the table being set to the inserted row. Inserted rows are displayed at the bottom of the table. (See table concepts and capabilities for more information) |
|
|
|
|
Examples: |
insertrow
EXPENSES; // set initial values for the first row set EXPENSES-START_DATE = $SYSTEM_DATE; set EXPENSES-DESCRIPTION = 'First empty
row'; insertrow
EXPENSES; // set initial values for the second row set EXPENSES-START_DATE = $SYSTEM_DATE; set EXPENSES-DESCRIPTION = 'Second empty row'; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
expression can be a literal value, another form field, an arithmetic expression, a function call, or any combination of these (see expressions). |
|
|
|
|
Description: |
expression is evaluated and then executed as an FPL script command. |
|
|
|
|
Restrictions: |
Can be used to execute all FPL commands
with the exception of: if, else, loop, endloop,
callscript, interpret. |
|
|
|
|
Examples: |
//
issue hide command set
GROUP_NAME = 'GR1'; interpret
'hide ' + GROUP_NAME; //
issue message command set
MSG_NO = 1016; interpret
'message E, ' + tostring(MSG_NO);
|
|
$COMMAND_STATUS: |
$COMMAND_STATUS is set by the FPL command evaluated. |
|
Syntax: |
lock resource name, id; resource name is the name of the resource to be locked id is the unique identifier within the resource |
|
|
|
|
Description: |
locks the specified resource id so that it cannot be accessed by another user. An unlock command should be issued when the resource is no longer required. The system will automatically release all held locks at the end of each form execution. (See Support for transactions for more information) |
|
|
|
|
Examples: |
// Lock material specified by field
MATERIAL_ID lock 'MATERIAL', MATERIAL_ID; if [ $COMMAND_STATUS = 'ERROR' ]
message E,nnnn; endif |
|
$COMMAND_STATUS: |
OK |
- lock has been acquired |
|
|
ERROR |
- the lock is held by another user |
|
Syntax: |
log expression; expression can be a literal value, another form field, an arithmetic expression, a function call, or any combination of these (see expressions). |
|
|
|
|
Description: |
writes the evaluated expression to the Ebase execution log viewable from the designer viewà executionlog. This command is intended for use in debugging. |
|
|
|
|
Examples: |
log FIELD2; log 'FIELD2 has the value: ' + FIELD2; log 'Integer value is: ' + tostring(INTEGER_FIELD); |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
loop [ expression ] commands; endloop
expression is any expression that returns true or false (see expressions).
· Each loop statement must be terminated by an endloop · Loops can be nested to any level · The break statement can be used to terminate execution of a loop · To protect against infinite loops, the system has a maximum loop counter which can be set (see UFS startup properties). The default value for this counter is 10,000. |
|
|
|
|
Description: |
the loop expression is evaluated before the statements within loop/endloop are executed. If the expression evaluates as true the statements are executed. This processing is repeated until either the loop expression evaluates as false or a break statement is encountered. |
|
|
|
|
Examples: |
set COUNTER = 1; loop [ COUNTER <= 10 ]
log 'This is loop pass: ' + tostring(COUNTER);
.....other commands
set COUNTER = COUNTER + 1; endloop |
|
$COMMAND_STATUS: |
Not applicable |
|
|
Syntax: |
loop at [TABLE] table_name commands;
table_name is the name of a table
· Each loop statement must be terminated by an endloop · Loops can be nested to any level · The break statement can be used to terminate execution of a loop · To protect against infinite loops, the system has a maximum loop counter which can be set (see UFS startup properties). The default value for this counter is 10,000. |
|
|
|
|
Description: |
loops through all rows of the named table refreshing the current row pointer with each new pass through the loop. References to a table column within the loop are interpreted as referring to the occurrence of the column on the current row. Processing is repeated until either all tables have been processed or a break statement is encountered.
|
|
|
|
|
Examples: |
loop at table ORDER_ITEMS
set ORDER_TOTAL = ORDER_TOTAL + ORDER_ITEMS-AMOUNT; endloop ORDER_ITEMS-AMOUNT is a table column, ORDER_TOTAL is a field not included in the table) |
|
$COMMAND_STATUS: |
Not applicable |
|
|
Syntax 1: Syntax 2: |
message type, messagenumber [,parm1, parm2, parm3 ......]; message 'text'; type can have three possible values :
messagenumber is the number of the message to be issued parm1, parm2 etc. represent up to ten form fields whose value will be substituted into the message text is the message text for a simple message
A substitutable field within a message is indicated by &&. Up to ten substitutable fields can be added to each message. |
|
|
|
|
Description: |
sends a message to the end user.
Error messages: can only be issued from field-on-page, table, or page events and will result in the error message being displayed above the field being processed or, in the case of page messages, at the bottom of the page. When an error message issued from an after event ( either a validation, on click, on change, after table, or after page event) form processing will immediately stop, and the page will be displayed to the user so the error can be corrected. When an error message is issued from a before event, processing will continue. See event concepts for more information.
Warning messages: can only be issued from field or page events and will result in the warning message being displayed above the field being processed or, in the case of page messages, at the bottom of the page. In contrast to error messages, warning messages do not stop form processing and any number of warning messages can be displayed on a page.
Final page messages: will only be displayed on the form's final page after form processing has completed. These can be issued at any time during form processing. All final messages, issued during the entire form session, will appear in the order they were issued.
The simple syntax displays an error message to the end user. This syntax does not provide support for multiple languages, substitution of form field variables into the message, or warning or final messages. |
|
|
|
|
Examples: |
message E, 1234, LOAN_AMOUNT; where:
message sent : Requested loan amount £15000 is below the minimum of £30000
message W, 2223;
message F, 5678, 'Thankyou
for using online voting'; where message 5678 contains : &&
message 'No credit available at this time'; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
PDFPrint [ PRINTFORMNAME ] [ save ] [ empty ] [ nodisplay ];
PRINTFORMNAME
is the name of the print form to be displayed. If omitted, the default print
form for the form being executed is displayed. Please note that PRINTFORMNAME is case sensitive.
save instructs the system to additionally save the completed document on the server. See working with files for more information. empty instructs the system to just generate a PDF document and not populate it with data from the form nodisplay instructs the system to suppress the display of the PDF document. This should only be used in conjunction with save. |
|
|
|
|
Description: |
Generates (and optionally saves) a PDF form document and displays this to the user in a popup window. See printing for details of using this command. |
|
|
|
|
Examples: |
PDFPrint
PF1; PDFPrint
PF2 save nodisplay; PDFPrint
PF3 empty; PDFPrint; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
print PRINT_RESOURCE [ ( component_prefix ) [ and save [ nodisplay ] ];
component_prefix is the name of the component prefix where the command is directed to a resource in a component business view PRINT_RESOURCE is the name of a printing resource, or the name of a form field containing a resource name. and save instructs the system to additionally save the completed document on the server. See working with files for more information. nodisplay instructs the system to suppress the display of the print document. This can only be specified in conjunction with save. |
|
|
|
|
Description: |
displays the print document specified in the printing resource and transfers all mapped fields from the Ebase form to the document. see working with printing resources.
The optional component_prefix is used to direct a command from a form level event to a resource within a component business view. See component concepts for more details. |
|
|
|
|
Examples: |
print
APPLICATIONS_PDF; print
APPLICATIONS_PDF and save; print
APPLICATIONS_PDF and save nodisplay; print
PDF1 ( COMP1 ); |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
read RESOURCE [ ( component_prefix ) [ BINDING ]; component_prefix is the name of the component prefix where the command is directed to a resource in a component business view RESOURCE is the name of an XML resource, MQ resource, or custom resource, or the name of a form field containing a resource name BINDING is optional |
|
|
|
|
Description: |
XML resources: reads an XML document via the resource using the adaptor specified by BINDING (or the default adaptor if BINDING is not specified) and populates all mapped form fields. See working with XML resources. MQ resources: reads a message from the MQSeries queue identified by the named MQ resource and populates all mapped form fields. See working with MQ resources.
The optional component_prefix is used to direct a command from a form level event to a resource within a component business view. See component concepts for more details. |
|
|
|
|
Examples: |
read
MY_SOURCE; read
XML1 ( COMP1 ); |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
|
READ_ERROR |
- a read was issued but the operation failed (MQ only) |
|
|
EMPTY |
- queue is empty (MQ only) |
|
Syntax: |
return; This command has no operands. |
|
|
|
|
Description: |
This command is typically used in conjunction with the callscript command to return processing control from the current script to the script that called it. If there is no calling script then the return command will exit the current script at that point where the return is issued. |
|
|
|
|
Examples: |
return; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
resettable TABLE; |
|
|
|
|
Description: |
This command clears the entire contents of the table and resets the current row. If a resource is attached to the table, issuing an updatetable will not remove the contents of the table from the attached resource.
See table concepts and capabilities for more information. |
|
|
|
|
Examples: |
resettable T1; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
returnfrom form; This command has no operands. |
|
|
|
|
Description: |
This command should only be used in conjunction with the call form command and is used to return from the called form to the calling form. Any fields on the called form marked as "returnable" will be returned to the calling form. Please note that return fields must have the same name in both the calling and called forms. |
|
|
|
|
Examples: |
returnfrom form; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
This command has no operands. |
|
|
|
|
Description: |
Rolls back the current transaction, backing out any updates. A new transaction is then started to handle any additional processing. Execution continues with the next FPL statement. See transaction support for more details. |
|
|
|
|
Examples: |
if [ $COMMAND_STATUS != 'OK' ]
rollback;
message E,1234; endif |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
sendmail RESOURCE [ ( component_prefix ) [ with attachments expression1, expression2, ...]; component_prefix is the name of the component prefix where the command is directed to a resource in a component business view RESOURCE is the name of an email resource, or the name of a form field containing a resource name expression1, expression2 etc are either names of form fields, system variables or literal values containing the full path to a file to be added as an attachment to the email message |
|
|
|
|
Description: |
sends the email message as specified in the email resource. Any substitutable fields in the email will be filled with values from the mapped form fields. . If <email resource> is omitted, the sendmail command will be issued to all email resources in the business view associated with the form in the order specified in the business view. See working with email resources.
The optional [ with attachments expression1, expression2, ...] can be added to attach files to the message. See working with files for a more complete description of sending emails with attachments. Note that if the sendmail command fails for any reason e.g. the email server is unavailable, the behaviour of the system depends on the setting of the checkbox “setting of this email is critical” in the email resource:
The optional component_prefix is used to direct a command from a form level event to a resource within a component business view. See component concepts for more details. |
|
|
|
|
Examples: |
sendmail NOTIFICATION_MESSAGE; sendmail NOTIFICATION_MESSAGE with attachments
$FILE_NAME; sendmail NOTIFICATION_MESSAGE with attachments
‘file1.xml’, ‘file2.doc’; sendmail MESSAGE1 ( COMP1 ); |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
|
ERROR |
- command has failed (see explanation under Description) |
|
Syntax: |
sequence SEQUENCENAME; SEQUENCENAME is the name of the sequence. |
|
|
|
|
Description: |
The specified sequence is incremented and the next number is placed in system variable $NEXT_SEQUENCE_ID. See working with sequences. |
|
|
|
|
Examples: |
sequence APPLICATIONS; set APPLICATION_ID = $NEXT_SEQUENCE_ID; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
set BUTTON_NEXTPAGE [ on PAGENAME] HIDDEN; set BUTTON_PREVIOUSPAGE [ on PAGENAME] HIDDEN; set BUTTON_FINISH HIDDEN; set BUTTON_SAVE HIDDEN set BUTTON_RESTORE HIDDEN;
PAGENAME is the name of the page containing the button
BUTTON_NEXTPAGE is the next page button BUTTON_PREVIOUSPAGE is the previous page button BUTTON_FINISH is the finish button BUTTON_SAVE is the save button BUTTON_RESTORE is the restore button
if on PAGENAME is omitted, the current page is processed |
|
|
|
|
Description: |
the specified button will not appear on the page. These commands override the system default processing for the display of buttons. For the finish, save and restore buttons, the command will apply to the current page and all subsequent pages. For the next page and previous page buttons, the command applies only to the specified page.
(see the UNSET command for the reverse process) |
|
|
|
|
Examples: |
set BUTTON_ PREVIOUSPAGE HIDDEN; set BUTTON_ PREVIOUSPAGE on Page_2 HIDDEN; set BUTTON_ SAVE HIDDEN; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
set BUTTON_NEXTPAGE [ on PAGENAME] = expression; set BUTTON_PREVIOUSPAGE [ on PAGENAME] = expression; set BUTTON_FINISH = expression; set BUTTON_SAVE = expression set BUTTON_RESTORE = expression;
expression can be a literal value, another form field, an arithmetic expression, a function call, or any combination of these (see expressions).
BUTTON_NEXTPAGE is the next page button BUTTON_PREVIOUSPAGE is the previous page button BUTTON_FINISH is the finish button BUTTON_SAVE is the save button BUTTON_RESTORE is the restore button
if on PAGENAME is omitted, the current page is processed |
|
|
|
|
Description: |
assigns a text value to the specified Ebase system-provided button. It cannot be used for other buttons. |
|
|
|
|
Examples: |
set BUTTON_NEXTPAGE = 'Accept conditions'; set BUTTON_FINISH = 'Submit application'; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
set column COLUMNNAME in table TABLENAME [ on PAGENAME] DISPLAYONLY | HIDDEN | MANDATORY;
COLUMNNAME is the field name of any column in the table including the table prefix e.g. MYTAB-NAME TABLENAME is the name of the table PAGENAME is the name of the page containing the table
if on PAGENAME is omitted, the field is assumed to be on the current page |
|
|
|
|
Description: |
changes the display attributes for the specified column on all rows of the specified table on the specified page
DISPLAYONLY - data cannot be entered by the user. Dropdown lists, radio buttons and checkboxes will display the selected value as a text field. HIDDEN - column will not appear in the table MANDATORY - table cells are treated as mandatory and must be entered by the user on every row
This command cannot be issued from a table cell event or within a loop at table construct.
(see the unset column command for the reverse process) |
|
|
|
|
Examples: |
set column EMPLOYEES-SALARY in table
EMPLOYEES HIDDEN; set column EXPENSES-VAT in table EXPENSES
on PAGE_1 MANDATORY; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
set JSP_TOP = expression; set JSP_BOTTOM = expression; set JSP_LEFT = expression; set JSP_RIGHT = expression;
expression can be a literal value, a form field, an arithmetic expression, a function call, or any combination of these (see expressions). The word null indicates that no JSP should be applied. |
|
|
|
|
Description: |
sets the URL of the corresponding JSP used on the current page and all subsequent pages. This specification will be used until another set JSP command is executed or until the form ends. |
|
|
|
|
Examples: |
set JSP_TOP = 'salesproj/jsps/top_panel.jsp'; set JSP_LEFT = null; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
set FIELDNAME = expression;
FIELDNAME is the name of any field in the form. Buttons cannot have a value. expression can be a literal value, another form field, an arithmetic expression, a function call, or any combination of these (see expressions). |
|
|
|
|
Description: |
assign a value to a field |
|
|
|
|
Examples: |
set FIELD_1 = 'Hello'; set FIELD_2 = FIELD_1; set FIELD_3 = FIELD_1 + ' and ' + FIELD_2; set FIELD_4 = substring(FIELD_1, 3); set DELIVERY_DATE = $SYSTEM_DATE + 10; set FINAL_AMOUNT = LOAN_AMOUNT + (LOAN_AMOUNT * (INTEREST_RATE / 100) * PERIOD_OF_LOAN ); |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
set FIELDNAME [ : id ] [ [ in ] table TABLENAME ] [ on PAGENAME] DISPLAYONLY | HIDDEN | MANDATORY | HYPERLINK;
FIELDNAME is the name of any field in the form TABLENAME is the name of the table containing column FIELDNAME PAGENAME is the name of the page containing the field Id is the numerical field identifier. If field FIELDNAME appears more than once on the specified page, the id is used to identify the specific occurrence. If not specified, the first field on the page named FIELDNAME is used.
if on PAGENAME is omitted, the field is assumed to be on the current page in table TABLENAME can be omitted where a table context exists e.g. inside a loop at table construct. |
|||||||||
|
|
|
||||||||
|
Description: |
changes the display attributes for the specified field on the specified page. If the specified field is a table cell, the command is applied to the current row of the containing table.
(see the unset command for the reverse process)
|
||||||||
|
Examples: |
set FIELD_1 HIDDEN; set FIELD_2 on LAST_PAGE DISPLAYONLY; set FIELD_£ MANDATORY; set DUPLICATED_FIELD : 70 DISPLAYONLY; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
set group GROUPNAME [ on PAGENAME] DISPLAYONLY | HIDDEN | MANDATORY;
GROUPNAME is the name of any group on the specified page PAGENAME is the name of the page containing the group
if on PAGENAME is omitted, the group is assumed to be on the current page |
||||||
|
|
|
||||||
|
Description: |
changes the display attributes for all fields in the specified group on the specified page
(see the unset command for the reverse process) |
||||||
|
|
|
||||||
|
Examples: |
set group SALARY HIDDEN; set group ADDRESS on PAGE_3 DISPLAYONLY; set group G1 MANDATORY; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
set nextpage PAGENAME;
PAGENAME is the name of the next page |
|
|
|
|
Description: |
sets the next page to be displayed when the user clicks the system-provided next page button |
|
|
|
|
Examples: |
set nextpage PRODUCT_DETAIL; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
set table [ ON PAGENAME ] TABLENAME.PROPERTYNAME = expression;
PAGENAME the name of the page containing the table TABLENAME is the name of the table. This can also be specified as TABLENAME:id when the same table
exists twice on a page ( where id is the numerical field identifier).. PROPERTYNAME
is the name of the property to be
set expression can be a literal value, another form field, an arithmetic expression, a function call, or any combination of these (see expressions). |
|||||||||||||||||||||
|
|
|
|||||||||||||||||||||
|
Description: |
sets a property on the specified table. The following table shows the supported properties and supported property values:
When the numrows property is set, the scroll position is reset to the top of the table.
See also field and table properties. |
|||||||||||||||||||||
|
|
|
|||||||||||||||||||||
|
Examples: |
set
table ACCOUNTS.numrows = 10; set
table ADDRESSES.columnHeaders = false; set
table ACCOUNTS.displayInfo = false; set
table on PAGE_5 ACCOUNTS.supportsAddRow = true; set table ACCOUNTS:310.supportsSelectRow = false; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
set template templateid;
templateid is the name of the new presentation template to be applied to the form. |
|
|
|
|
Description: |
changes the presentation template |
|
|
|
|
Examples: |
set template NEW_TEMPLATE; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
!!
THIS COMMAND IS DEPRECATED AS OF EBASE V3.4.0. To change a text dynamically,
include && field variables in the text (see working with form texts).
|
Syntax: |
set text textid1 = 'text'; set text textid1 = textid2;
textid1, textid2 is the system generated number of the text (text numbers can be displayed by clicking the Maintain texts button in the form editor) 'text' is a text string enclosed within single quotes |
|
|
|
|
Description: |
changes a text to be displayed to either a literal value or to another form text value. This is a temporary change and lasts only to the end of the form.
Note that text ids can be changed when a form is imported. Therefore, changing a text using this command is unreliable. Use && field variables instead (see working with form texts). |
|
|
|
|
Examples: |
set text 1286543 = 'Your answer is not clear - please provide additional details'; set text 1286543 = 1286121; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
setfocus FIELDNAME [ : id ] [ [ in ] table TABLENAME ] [ on PAGENAME ] [ ERROR ]; setfocus $NULL [ on PAGENAME ];
FIELDNAME is the name of any field in the form PAGENAME is the name of the page containing the field TABLENAME is the name of the table containing FIELDNAME ERROR indicates that error field formatting should be applied Id is the numerical field identifier. If field FIELDNAME appears more than once on the specified page, the id is used to identify the specific occurrence. If not specified, the first field on the page named FIELDNAME is used.
If on PAGENAME is omitted, the field is assumed to be on the current page If ERROR is not specified, standard formatting is applied in table TABLENAME can be omitted when setting focus to a table column where a table context exists e.g. inside a loop at table construct. |
|
|
|
|
Description: |
sets the focus to the specified field or table cell. If the specified field is a table cell, the command is applied to the current row of the containing table. setfocus $NULL indicates that all focus should be suppressed for the next display of the specified page. See controlling focus for further details. |
|
|
|
|
Examples: |
setfocus
CUSTOMER_NAME; setfocus
CUSTOMER_NAME ERROR; setfocus
ORDER-AMOUNT table ORDERS; setfocus
ORDER-AMOUNT in table ORDERS on PAGE_9; setfocus $NULL; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
setrow SELECTED | DELETED | EMPTY; |
|
|
|
|
Description: |
changes the status of the current row in the current table to either selected, deleted or empty and sets the corresponding system variable $ROW_SELECTED, $ROW_DELETED or $ROW_EMPTY. This command can be reversed using the unsetrow command. |
|
|
|
|
Examples: |
loop at table ACCOUNTS if
[ ACCOUNT_NO = null ]
setrow empty; endif endloop |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
show BUTTON_NEXTPAGE [ on PAGENAME ]; show BUTTON_ PREVIOUSPAGE [ on PAGENAME]; show BUTTON_ FINISH; show BUTTON_ SAVE; show BUTTON_ RESTORE;
PAGENAME is the name of the page containing the button
BUTTON_NEXTPAGE is the next page button BUTTON_PREVIOUSPAGE is the previous page button BUTTON_FINISH is the finish button BUTTON_SAVE is the save button BUTTON_RESTORE is the restore button
if on PAGENAME is omitted, the current page is processed |
|
|
|
|
Description: |
the specified button will appear on the page. These commands override the system default processing for the display of buttons. For the finish, save and restore buttons, the command will apply to the current page and all subsequent pages. For the next page and previous page buttons, the command applies only to the specified page. This command is synonymous with command unset BUTTONNAME [ on PAGENAME] HIDDEN.
(see the HIDE command for the reverse process) |
|
|
|
|
Examples: |
show BUTTON_ PREVIOUSPAGE HIDDEN; show BUTTON_ PREVIOUSPAGE on Page_2 HIDDEN; show BUTTON_ SAVE HIDDEN; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
show FIELDNAME [ : id ] [ [ in ] table TABLENAME ] [ on PAGENAME];
FIELDNAME is the name of any field in the form TABLENAME is the name of the table containing FIELDNAME PAGENAME is the name of the page containing the field Id is the numerical field identifier. If field FIELDNAME appears more than once on the specified page, the id is used to identify the specific occurrence. If not specified, the first field on the page named FIELDNAME is used.
if on PAGENAME is omitted, the field is assumed to be on the current page in table TABLENAME can be omitted where a table context exists e.g. inside a loop at table construct. |
|
|
|
|
Description: |
makes the specified field visible on the specified page. If the specified field is a table cell, the command is applied to the current row of the containing table. This command performs the same function as command: unset FIELDNAME [ on PAGENAME] HIDDEN
(see hide command for the reverse process) |
|
|
|
|
Examples: |
show FIELD_1; show FIELD_2 on LAST_PAGE; show FIELD_2 in table ACCOUNTS; show DUPLICATED_FIELD : 70; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
show column COLUMNNAME [ in ] table TABLENAME [ on PAGENAME];
COLUMNNAME is the name of any column in the table including the table prefix e.g. MYTAB-NAME TABLENAME is the name of the table PAGENAME is the name of the page containing the table
if on PAGENAME is omitted, the table is assumed to be on the current page |
|
|
|
|
Description: |
makes the specified table column visible on the specified page. This command performs the same function as command: unset column COLUMNNAME [ in ] TABLENAME [ on PAGENAME] HIDDEN
(see hide column command for the reverse process) |
|
|
|
|
Examples: |
show column EMPLOYEES-SALARY in table
EMPLOYEES; show column EMPLOYEES-VAT table EMPLOYEES on DETAILS; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
show group GROUPNAME [ on PAGENAME]; GROUPNAME is the name of any group on the specified page PAGENAME is the name of the page containing the group
if on PAGENAME is omitted, the group is assumed to be on the current page |
|
|
|
|
Description: |
makes all fields in the specified group visible on the specified page. This command performs the same function as command: unset group GROUPNAME [ on PAGENAME] HIDDEN
(see the HIDE GROUP command for the reverse process) |
|
|
|
|
Examples: |
show group G1; show group G2 on PAGE_9; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
sort TABLENAME [ by ] COL1 [ ASCENDING | ASC | DESCENDING | DESC ], [ COL2 [ ASCENDING | ASC | DESCENDING | DESC ] ]......; TABLENAME is the name of the table to be sorted CO1, COL2… are the names of any columns in the table including the table prefix e.g. MYTAB-NAME ASCENDING is the default sort direction if not specified. |
|
|
|
|
Description: |
sorts the table in the order of the specified columns and sets the current row for the table to the first row in the newly sorted order |
|
|
|
|
Examples: |
sort CUSTOMER by CUSTOMER-NAME; sort CUSTOMER by CUSTOMER-TOTAL_OWED
DESCENDING; sort EXPENSES by EXPENSES-TYPE,
EXPENSES-AMOUNT DESC; sort MYTAB MYTAB-COL1 ASCENDING, MYTAB-COL2 DESCENDING, MYTAB-COL3, MYTAB-COL4 ASCENDING; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
unhighlight FIELD FIELDNAME [ : id ] [ on PAGENAME ]; unhighlight ROW; unhighlight TABLECELL COLUMNNAME; unhighlight ALL;
FIELDNAME is the name of any field in the form PAGENAME is the name of the page containing the field. If omitted, the field is assumed to be on the current page Id is the numerical field identifier. If field FIELDNAME appears more than once on the specified page, the id is used to identify the specific occurrence. If not specified, the first field on the page named FIELDNAME is used. COLUMNNAME is the name of any column in the current table |
|
|
|
|
Description: |
removes any presentation highlighting style from the specified field, table row or individual table cell. The unhighlight row and unhighlight tablecell commands are interpreted as applying to the current table and these commands can only be issued when a table context applies i.e. within a loop at table....endloop construct or when processing a before or after event for a table or table cell. If ALL is specified, all highlights are removed from the current page. This command reverses the effect of the highlight command.
See working with presentation templates for information on creating and maintaining highlighting styles. |
|
|
|
|
Examples: |
unhighlight field FIELD_1; unhighlight field FIELD_2 on LAST_PAGE; unhighlight field DUPLICATED_FIELD : 120; unhighlight row; unhighlight tablecell T-COL1 unhighlight all; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
unlock RESOURCENAME, id;
RESOURCENAME name is the name of the resource to be unlocked id is the unique identifier within the resource |
|
|
|
|
Description: |
unlocks the specified resource id so that it can now be accessed by another user. This is the reverse of the lock command. Note that the system will automatically release all held locks at the end of each form execution. See Support for transactions for more information. |
|
|
|
|
Examples: |
unlock 'MATERIAL', MATERIAL_ID
(where MATERIAL_ID is a form field) |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
unset BUTTON_NEXTPAGE [ on PAGENAME] HIDDEN; unset BUTTON_ PREVIOUSPAGE [ on PAGENAME] HIDDEN; unset BUTTON_ FINISH HIDDEN; unset BUTTON_ SAVE HIDDEN; unset BUTTON_ RESTORE HIDDEN;
PAGENAME is the name of the page containing the button
BUTTON_NEXTPAGE is the next page button BUTTON_PREVIOUSPAGE is the previous page button BUTTON_FINISH is the finish button BUTTON_SAVE is the save button BUTTON_RESTORE is the restore button
if on PAGENAME is omitted, the current page is processed |
|
|
|
|
Description: |
the specified button will appear on the page. These commands override the system default processing for the display of buttons. For the finish, save and restore buttons, the command will apply to the current page and all subsequent pages. For the next page and previous page buttons, the command applies only to the specified page.
(see the SET command for the reverse process) |
|
|
|
|
Examples: |
unset BUTTON_ PREVIOUSPAGE HIDDEN; unset BUTTON_ PREVIOUSPAGE on Page_2
HIDDEN; unset BUTTON_ SAVE HIDDEN; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
unset column COLUMNNAME in table TABLENAME [ on PAGENAME] DISPLAYONLY | HIDDEN | MANDATORY;
COLUMNNAME is the field name of any column in the table including the table prefix e.g. MYTAB-NAME TABLENAME is the name of the table PAGENAME is the name of the page containing the table if on PAGENAME is omitted, the field is assumed to be on the current page |
|
|
|
|
Description: |
changes the display attributes for the specified column on all rows of the specified table on the specified page
DISPLAYONLY - data can be entered by the user HIDDEN - column will appear in the table MANDATORY - table cells are treated as optional
This command cannot be issued from a table cell event or within a loop at table construct.
(see the set column command for the reverse process) |
|
|
|
|
Examples: |
unset column EMPLOYEES-SALARY in table
EMPLOYEES HIDDEN; unset column EXPENSES-VAT in table EXPENSES on PAGE_1 MANDATORY; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
unset FIELDNAME [ : id ] [ [ in ] table TABLENAME ] [ on PAGENAME] DISPLAYONLY | HIDDEN | MANDATORY | HYPERLINK;
FIELDNAME is the name of any field in the form TABLENAME is the name of the table containing FIELDNAME PAGENAME is the name of the page containing the field Id is the numerical field identifier. If field FIELDNAME appears more than once on the specified page, the id is used to identify the specific occurrence. If not specified, the first field on the page named FIELDNAME is used.
if on PAGENAME is omitted, the field is assumed to be on the current page in table TABLENAME can be omitted where a table context exists e.g. inside a loop at table construct. |
|||||||||
|
|
|
||||||||
|
Description: |
changes the display attributes for the specified field on the specified page and is the reverse of the corresponding set command. If the specified field is a table cell, the command is applied to the current row of the containing table.
(see the set command for the reverse process) |
||||||||
|
|
|
||||||||
|
Examples: |
unset FIELD_1 HIDDEN; unset FIELD_2 on LAST_PAGE DISPLAYONLY; unset FIELD_£ MANDATORY; unset FIELD_3 table T1 MANDATORY; unset DUPLICATED_FIELD : 70 DISPLAYONLY; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
unset group GROUPNAME [ on PAGENAME] DISPLAYONLY | HIDDEN | MANDATORY;
GROUPNAME is the name of any group on the specified page PAGENAME is the name of the page containing the group if on PAGENAME is omitted, the group is assumed to be on the current page |
|
|
|
|
Description: |
changes the display attributes for all fields in the specified group on the specified page, and is the reverse of the corresponding set command
DISPLAYONLY - data can be entered by the user HIDDEN - fields will be displayed on the page MANDATORY - fields will be treated as optional
(see the set command for the reverse process) |
|
|
|
|
Examples: |
unset group SALARY HIDDEN; unset group ADDRESS on PAGE_3 DISPLAYONLY; unset group G1 MANDATORY; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
unsetrow SELECTED | DELETED | EMPTY; |
|
|
|
|
Description: |
resets the selected, deleted or empty status of the current row in the current table and sets the corresponding system variable $ROW_SELECTED, $ROW_DELETED or $ROW_EMPTY. This command can be reversed using the setrow command. (See table concepts and capabilities for more information) |
|
|
|
|
Examples: |
loop at table ACCOUNTS if
[ $ROW_SELECTED = 'Y' ]
callscript PROCESS_SELECTION;
unsetrow selected; endif endloop |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
update RESOURCE [ ( component_prefix ) [ BINDING ]; component_prefix is the name of the component prefix where the command is directed to a resource in a component business view RESOURCE is the name of a database or custom resource, or the name of a form field containing a resource name. BINDING is optional and is applicable only for custom resources |
|
|
|
|
Description: |
updates a single row in the database resource setting column values from the mapped form fields. If any of the resource fields are marked as required but have no value when this command is issued, the form terminates with an appropriate message. Whenever an update is attempted, the number of records updated (if any) depends on the where clause in the database resource.
If the optimistic locking option has been activated in form properties, the system will check that the database record to be updated has not been altered by an external system since it was originally fetched. If this check fails, the command will return a status other than OK. (See $COMMAND_STATUS settings below).
The optional component_prefix is used to direct a command from a form level event to a resource within a component business view. See component concepts for more details. |
|
|
|
|
Examples: |
update
APPLICATION; update
APPLICATION ( COMP1 ); CAUTION! Issuing an update
against a database resource with no WHERE clause specified will update all
records in the database table. |
|
$COMMAND_STATUS: |
OK |
- operation was successful, this includes the following scenarios:
|
|
|
ERROR |
- an update could not be attempted or was attempted but the operation failed |
|
|
NOT_FOUND |
- optimistic locking is set to 'Yes' - the record fetched earlier no longer exists, the update has not been performed |
|
|
VALUES_CHANGED |
- optimistic locking is set to 'Yes' - one/more of the fetched fields now contain a different value, the update has not been performed |
|
Syntax: |
upload; |
|
|
|
|
Description: |
displays the upload page and allows the user to upload one or more files. The following system variables are set as a result of executing this command:
$FILE_NAME The full path name on the server of the uploaded file $FILE_NAME_USER The last portion of the file name on the client
See working with files for a more complete description of uploading files using this command. |
|
|
|
|
Examples: |
upload; set FILE_CV = $FILE_NAME; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
updatetable TABLE;
TABLE is the name of a table in the form. |
|
|
|
|
Description: |
updates the external resource specified as the backing resource for the table with the table data.
Note that optimistic locking processing is not available for tables. (See table concepts and capabilities for more information) |
|
|
|
|
Examples: |
updatetable CUSTOMERS; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
Syntax: |
write RESOURCE [ ( component_prefix ) [ BINDING | WAIT ] ; component_prefix is the name of the component prefix where the command is directed to a resource in a component business view RESOURCE is the name of an MQ or custom resource, or the name of a form field containing a resource name BINDING is optional |
|
|
|
|
Description: |
XML resources: writes an XML document to the specified XML resource using the adaptor specified by BINDING (or the default adaptor if BINDING is not specified) The WAIT option is not applicable to XML resources. The document is populated from mapped form fields. See working with XML resources
MQ resources: sends a message to the MQSeries queue identified by the named MQ resource. Message is populated from mapped output form fields. If WAIT is specified, additionally waits for a reply and populates mapped input form fields with data from the reply message. See working with MQ resources.
The optional component_prefix is used to direct a command from a form level event to a resource within a component business view. See component concepts for more details. |
|
|
|
|
Examples: |
write XMLOUT; write XMLOUT ( COMP1 ); write CREDIT_CHECK_QUEUE wait; |
|
$COMMAND_STATUS: |
OK |
- command executed successfully |
|
|
WRITE_ERROR |
- a write was issued but the operation failed (MQ only) |
|
|
READ_ERROR |
- a write with WAIT was issued but the operation failed reading from the reply queue (MQ only) |
|
|
EMPTY |
- a write with WAIT was issued but the reply did not arrive (MQ only) |
A number of system variables are maintained automatically by the system. These are all read only except where indicated otherwise. Examples of using system variables include:
set DUEDATE = $SYSTEM_DATE + 30;
if [ $COMMAND_STATUS != 'OK' ] ......
Contains the details of any runtime failure. After an abort command, contains the abort reason.
Contains the name of the page at the time of a runtime failure or abort command. Will contain null if no current page exists e.g. when running a before or after form event.
When the browser back button has been clicked, contains the name of the current form prior to the user clicking the back button. Contains no value when the current page and the page returned to are within the same form. This variable is read only.
When the browser back button has been clicked, contains the name of the current page prior to the user clicking the back button. This variable is read only.
Contains 'Y' or 'N' to indicate whether or not use of the browser back button is supported for the current form. This variable is read/write.
When the browser back button has been clicked, contains the name of the back button target page. This variable is read only.
Contains 'Y' or 'N' to indicate whether or not the user has just clicked the browser back button. This variable is read only.
Contains value 'Y' if the form is processing in batch mode, or 'N' if the form is being processed online.
Contains the user-agent string from the HTTP header.
Returns either 'Y' or 'N' to indicate whether the client browser is capable of supporting cookies.
Indicates whether the client browser is capable of supporting Javascript. Normally contains 'Y' or 'N'. Contains '?'' if there is no browser client e.g. executing in batch mode. See also variable $PRESENTATION_USE_JAVASCRIPT and Web Accessibility - support for Javascript.
Indicates whether the client browser is capable of supporting stylesheets . Normally contains 'Y' or 'N'. Contains '?'' if there is no browser client e.g. executing in batch mode. Note that if the client browser does not support Javascript, this variable will be set to 'N' and stylesheets will not be used to render HTML output. See also variable $PRESENTATION_USE_STYLESHEETS and Web Accessibility - options and attributes.
Contains the status of the last script command executed. Will contain 'OK' if the command executed successfully. See the individual commands for a list of the possible error statuses.
If the current event was triggered from a component and the currently executing script is a global script, this contains the component prefix. e.g. if component COMP1 is inserted into a form with prefix A_, the prefix will be A_COMP1__. Please note that $COMPONENT_PREFIX can only be used in a script. If it is referred to from other contexts e.g. as a substitutable variable in a text, a null value is returned.
The page name for the current page.
The name of the database to be used when dynamic databases have been specified. See using dynamic databases for more information.
The Ebase form session id that uniquely identifies this form context. This is a numeric value that is unique within the http session context of the end user.
After a fetch or fetchtable command, this variable contains the number of retrieved records.
Contains the full path of a file created by the system e.g. when creating an XML file using write RESOURCE_NAME, when uploading files using the upload command, or generating PDF documents with the print or PDFPrint commands.
Contains the last portion of the name of an uploaded file. e.g. if a user has uploaded a file from C:\My Documents\my_cv.doc, this variable will contain my_cv.doc.
The name of the form.
After a fetch command or a dynamic list check, this variable contains Y or N to indicate whether a record was found.
Contains Y or N to indicate whether or not the Ebase HTML <form> tag is positioned to include all JSP and HTML panels. See the explanation of parameter Ufs.globalHtmlForm in UFSSetup.properties for more information.
The language code for the user's session. This variable can be updated to dynamically change the runtime language e.g. See Language codes and Internationalization
set $LANGUAGE = 'NL';
The page name for the next page.
This is set by the sequence command and contains the next number from the specified sequence. See sequence command.
Indicates whether Javascript is being used to render HTML pages. Normally contains 'Y' or 'N'. Contains '?'' if there is no browser client e.g. executing in batch mode. This variable can be used to dynamically enable and disable the use of Javascript. e.g.
set $PRESENTATION_USE_JAVASCRIPT = 'N';
Javascript can only be dynamically enabled if the client browser provides support for Javascript, otherwise the command is ignored. See also variable $BROWSER_SUPPORTS_JAVASCRIPT and Web Accessibility - support for Javascript.
Indicates whether style sheets are being used to render HTML pages. Normally contains 'Y' or 'N'. Contains '?'' if there is no browser client e.g. executing in batch mode. This variable can be used to dynamically enable and disable the use of style sheets. e.g.
set $PRESENTATION_USE_STYLESHEETS = 'Y';
Dynamically enabling style sheets will always result in the use of style sheets in generated HTML regardless of the setting of $BROWSER_SUPPORTS_STYLESHEETS. See also variable $BROWSER_SUPPORTS_STYLESHEETS and Web Accessibility - options and attributes.
Indicates whether the system will display 'popup' windows as new windows or in the original form window. Normally contains 'Y' or 'N'. Contains '?'' if there is no browser client e.g. executing in batch mode. This variable can be used to dynamically enable and disable the use of popup windows. e.g.
set $PRESENTATION_USE_POPUPS = 'N';
(See Web Accessibility - Options and Attributes for more information)
Indicates whether the colours specified in the presentation template are displayed. When set to 'N', pages are displayed in black and white. This variable normally contains 'Y' or 'N'. It can contain '?'' if there is no browser client e.g. executing in batch mode. This variable can be used to dynamically enable and disable the use of colour. e.g.
set $PRESENTATION_USE_COLOUR = 'N';
(See Web Accessibility - Options and Attributes for more information)
Contains an integer that specifies how many times the font sizes specified in the presentation template should be incremented. This provides the ability to dynamically increase and decrease the size of all displayed texts. Setting this value to 0 resets sizes to the presentation template values.
set $PRESENTATION_ZOOM_AMOUNT = 2;
(See Web Accessibility - Options and Attributes for more information)
The page name for the previous page.
The name of the project containing the form.
Contains Y or N to indicate that the user has clicked the Delete checkbox for the current row of the table being processed. (See Table Concepts and Capabilities for more information)
Contains Y or N to indicate that the current row of the table being processed is empty. (See Table Concepts and Capabilities for more information)
Contains Y or N to indicate that the current row of the table being processed has been inserted by the user using the Add row button or using the FPL insertrow command. (See Table Concepts and Capabilities for more information)
Contains Y or N to indicate that the user has clicked the Select checkbox for the current row of the table being processed. (See Table Concepts and Capabilities for more information)
This system variable contains Y or N to indicate whether the user has previously saved a form, and therefore a restore is possible. This can be used to change the system's default behaviour regarding the appearance of the Save and Restore buttons.
The session id supplied by the application server for the current end-user session. This can contain a mixture of characters and numbers and will be a unique value within the current execution of the application server.
The current day's date. This should only be used in conjunction with Ebase form fields of type DATE. If used with a character field, the julian date will be displayed. For example:
set DATE_FIELD_1 = $SYSTEM_DATE;
The current day's date and time to second accuracy. This should only be used in conjunction with Ebase form fields of type DATETIME. For example:
set DATETIME_FIELD_1 = $SYSTEM_DATETIME;
Contains the system name as defined in UFSSetup.properties parameter Ufs.systemName. This variable is read only.
Indicates the setting of the global Javascript flag, Contains 'Y' or 'N'. (See Web Accessibility - Options and Attributes)
Indicates the setting of the global window popup flag, Contains 'Y' or 'N'. (See Web Accessibility - Options and Attributes)
Indicates the setting of the global colour button flag, Contains 'Y' or 'N'. (See Web Accessibility - Options and Attributes)
Indicates the setting of the global zoom button flag, Contains 'Y' or 'N'. (See Web Accessibility - Options and Attributes)
The current time as a string value in the format hh:mm. This can be assigned to form fields of type TIME or CHAR. For example:
set
TIME_FIELD_1 = $SYSTEM_TIME;
For computations involving time, use $SYSTEM_TIME_NOW.
The current time as an integer value representing the number of seconds since midnight. If assigned to a character or integer field, the integer value will be displayed. This system variable is intended to be used for time calculations. For example:
set
TIME_FIELD_1 = $SYSTEM_TIME_NOW + (60 *60); //
current time + 1 hour
where TIME_FIELD_1
is a field of type TIME.
Contains the end user’s userid. This field contains a value if user authentication is provided by either the application server or an Ebase logon exit. (See Security for more information)
These three variables are written as hidden fields on all Ebase form pages. They provide an opportunity for user written Javascript to set field values and to receive and process these values in a FPL script. For example, an HTML or JSP panel might contain a button that sets $USERVAR1 using Javascript and then submits the Ebase form. A control field could then be placed at the top of each page with a validation event script that checks for a value in $USERVAR1.
See Panel form interaction for more details on this technique and supported Javascript functions.
Contains the URL of the Ebase ufsmain servlet used to invoke the Ebase form. This contains the entire URL up to and including ufsmain, but omitting any passed parameters. e.g. http://localhost:8080/ufs/ufsmain
Contains the URL to return to Ebase after a CALL URL command. This is the full URL of the ufsreturn servlet. e.g.
call URL 'http://www.my.app.com/myProg?return=' + $UFS_RETURN_URL;
Contains the hostname of the Ebase Server.
Contains the unique workflow job id when a new workflow job is opened with the workflow open job or workflow start job commands. Also returns the unique workflow job id when referenced from a workflow system activity task or decision node (See form workflow facilities for more information).
Contains the unique workflow task id when the form is workflow’ed. (See form workflow facilities for more information).
This value is from an incoming integration request. It contains the name of the operation invoked from integration web service call. The operation name is bound to an Integration Adapter within an Integration Resource (See Integration Server for more information).
Contains the calling source that invoked the integration service. This is set to one of four values depending on the method of entry to invoke the integration service:
− Web – Integration service was invoked by an incoming request from a web based client.
− Designer –Integration service was invoked from the designer
− Form – Integration service was invoked from another form e.g call form MY_INTEGRATION_FORM
− Schedule – Integration service was invoked from a scheduled task.
This value is set from the JMS Adapter (See JMS Adapter for more information). The value contains the unique JMS message id of a message sent, received or called synchronously.
This value must be set within FPL when using the Send Receive JMS Adapter (See Send Receive JMS Adapter for more information). This value is validated with the JMS collaboration id returned from JMS.
The following is a list of system provided functions. Additional functions can be added to meet the needs of individual clients.
|
Syntax: |
|
|
|
|
|
Description: |
Adds the number of months specified by number1 to date1 and returns the new date. If weekdaysonly = 'TRUE' and the resulting date is a weekend (i.e. Saturday or Sunday), the returned date is adjusted to be the Monday following the new date. If weekdaysonly = 'FALSE' the new date is returned unadjusted regardless of whether or not it is a weekend. |
|
|
|
|
Examples: |
set NEWDATE = addmonth(OLDDATE,
3, 'TRUE'); |
|
Syntax: |
addresslookup (string1, string2) |
|
|
|
|
Description: |
This function is used to interface with the UK Postcode Anywhere service. Returns the number of addresses at postcode in string1. string2 must be a literal containing the name of a form field of display type selection. Populates string2 with list of addresses found, if any. |
|
|
|
|
Examples: |
set
ADDRESS_COUNT = addresslookup(POSTCODE,
'ADDRESSES'); |
|
Syntax: |
addressidlookup (string1, string2, string3, string4, string5, string6, string7) |
|
|
|
|
Description: |
This function is used to interface with the UK Postcode Anywhere service. Returns the number of addresses (always 1) for address id string1. string2 , string3, string4, string5, string6, string7 must be a literals containing names of form fields of display type text. Populates form fields represented by string2 , string3, string4, string5, string6, string7 with organization name, address line 1, address line 2, address line 3, town and county respectively for address id string1. |
|
|
|
|
Examples: |
set DUMMY = addresslookup(ADDRESS_ID,
'COMPANY_NAME', 'LINE_1', 'LINE_2', 'LINE_3', 'TOWN', 'COUNTY'); |
|
Syntax: |
|
|
|
|
|
Description: |
Adds the number of weeks specified by number1 to date1 and returns the new date. |
|
|
|
|
Examples: |
set NEWDATE = addweek(OLDDATE,
3); |
|
Syntax: |
addyear(date1, number1) |
|
|
|
|
Adds the number of years specified by number1 to date1 and returns the new date. |
|
|
|
|
|
Examples: |
set = addyear(OLDDATE,
25); |
|
Syntax: |
buildList(fieldName) |
|
|
|
|
Description: |
Builds the dynamic list associated with field fieldName. Fails if there is no dynamic list. Returns ‘OK’ to indicate the function has executed successfully. |
|
|
|
|
Examples: |
set RESP = buildList('MY_LIST_FIELD'); |
|
Syntax: |
buildlistfromtable(list_field_name, table_name, table_column_1_name, table_column_2_name )
where... list_field_name is the name of the field to which the list is attached table_name is the name of the table table_column_1_name is the name of the table column to be displayed in the list table_column_2_name is the name of the table column to be returned when a value is selected. This can be the same as table_column_1_name
Please note that all four parameters should be specified in quotes as shown in the example below. |
|
|
|
|
Description: |
Creates a list from a table. Returns the number of entries in the list - the return value should be assigned to a field of type INTEGER. The target field should have a display type that can display a list i.e. dropdown, radio button or checkbox. Function settablerow can be used to set the current row of the table when the user makes a selection. (See Table Concepts for more information) |
|
|
|
|
Examples: |
set NUMROWS = buildlistfromtable(
'CUSTOMERS_LIST', 'CUSTTAB', 'CUSTTAB-NAME', 'CUSTTAB-ID' ); |
|
Syntax: |
condense(string) |
|
|
|
|
Description: |
Returns string with all spaces removed. |
|
|
|
|
Examples: |
if [condense(NAME) = 'JohnBrown'
] ........ |
|
Syntax: |
contains(string1, string2) |
|
|
|
|
Description: |
Returns true if string1 contains string2. Otherwise returns false. |
|
|
|
|
Examples: |
if [ contains(USER_PREFERENCES, 'Caviar') ]
........ |
|
Syntax: |
datepart(date1,string2)
string2 is a date part as follows:
Valid DateParts (string2)
|
||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||
|
Description: |
Returns a character string representing part of the date. See also formatdate function. |
||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||
|
Examples: |
set RESULT = datepart($SYSTEM_DATE,
'Q'); |
|
Syntax: |
dayofweek(string1) |
|
|
|
|
Description: |
Returns day of the week as a string, for the given date which must be a string in format dd/mm/yyyy. Use the datepart function in preference to this function e.g. datepart(MYDATE, ‘DF’). |
|
|
|
|
Examples: |
set COMMENTS = dayofweek('01/08/2002'); if [dayofweek( datetostring(TIMESHEETDATE) ) != 'Friday'] ....... |
|
Syntax: |
encrypt(value, action [,key])
value is the value to be encrypted or decrypted action either 'ENCRYPT' or 'DECRYPT' key (optional) The key to use during encryption/decryption. If this is omitted then the system encryption settings will be used. |
|
|
|
|
Description: |
Returns an encrypted or decrypted value, in the same way as encrypting form parameters. Will return ERROR if there is a problem encrypting or decrypting the value. Only previously encrypted values can be decrypted. |
|
|
|
|
Examples: |
set ENCRYPTED_VALUE = encrypt(CUSTOMER_ID,
'ENCRYPT'); set CUSTOMER_ID = encrypt(ENCRYPTED_VALUE,
'DECRYPT'); set ENCRYPTED_PASSWORD =
encrypt(PASSWORD_FIELD, 'ENCRYPT', 'ASECRETKEE'); |
|
Syntax: |
endswith(string1, string2) |
|
|
|
|
Description: |
Returns true if string1 ends with string2. Otherwise returns false. |
|
|
|
|
Examples: |
if [endswith
(PRODUCT, 'OIL') ] ........ |
|
Syntax: |
fileexists(filepath)
filepath is a string or the name of a form field or a system variable containing the full path to a file on the server |
|
|
|
|
Description: |
Returns true if file represented by filepath exists . Otherwise returns false. |
|
|
|
|
Examples: |
if [fileexists('c:/ebase/UfsServer/generatedfiles/expenses.xls')] ........ if [fileexists($FILE_NAME)] ........ |
|
Syntax: |
formatdate(date1,string2)
date1 is a field of type DATE string2 is a format string as follows:
Format String Examples:
dd/MM/YYYY - 10/07/1996 EEE MMMM dd, YYYY
- EEE dd MMM, YYYY - Tue 10 Jul, 1996 |
||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||
|
Description: |
Formats the date
in date1 to the given format in string2. See also datepart function. |
||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||
|
Examples: |
set F1 = formatdate(DATE1,
'dd/MM/YYYY'); set F1 = formatdate(DATE1,
'EEE dd MMM, YYYY'); |
|
Syntax: |
formattemplate(string1 [ , string2 ] [ , loglevel ] )
string1 - specifies either the filename within the Velocity templates directory containing the template or the template itself depending on the contents of string2.
string2 - optional parameter. If specified it must contain either:
‘FILE’ indicates that string1 specifies a filename within the Velocity templates directory or… ‘INLINE’ indicates that string1 contains a template string
If omitted, the default for string2 is ‘FILE’.
loglevel - optional parameter. If specified it is an integer that designates the logging level. Only Velocity messages of the specified logging level or higher will be issued. Logging levels are:
Debug Info Warn Error
If omitted, the default for loglevel is 2. |
|
|
|
|
Description: |
Invokes the Velocity template engine and returns a formatted string. See Using Velocity for further details. |
|
|
|
|
Examples: |
set
RESULT = formattemplate('exampleTemplate.vm'); set
RESULT = formattemplate('#foreach
( $field in $fields )<field>$field</field>#end', 'INLINE'); |
|
Syntax: |
getcookie(name) |
|
|
|
|
Description: |
Returns the string value of a cookie called name. A zero length string will be returned if this cookie does not exist. See also function setcookie. |
|
|
|
|
Examples: |
// Set the value of the USER_NAME field to
the value of the cookie called USER set USER_NAME = getcookie
( 'USER' ); |
|
Syntax: |
getcredential(string) |
|
|
|
|
Description: |
Returns the value of the named user credential. |
|
|
|
|
Examples: |
set EMAIL_ADDRESS = getcredential('email'); |
|
Syntax: |
|
|
|
|
|
Description: |
Returns the form session variable with the name of string. Returns a zero length string if the form session variable does not exist. Objects are returned as a String by invoking their toString() method. Note that form session variables cannot be accessed when a form is running in batch mode.
See support for multiple sessions for more information on form sessions. See also function setformsessionvariable. |
|
|
|
|
Examples: |
set MYVAR = getformsessionvariable
( 'VAR1' ); |
|
Syntax: |
getlistdisplayvalue(fieldname) |
|
|
|
|
Description: |
Returns the currently displayed text for a field which is associated with a list. This is particularly useful for static list fields where there is usually a difference between the field value and the displayed value. |
|
|
|
|
Examples: |
set DISPLAYVALUE = getlistdisplayvalue
( 'MYLISTFIELD' ); |
|
Syntax: |
getprocessattribute(jobid, attributename) |
|
|
|
|
Description: |
Returns the value of the named process attribute for the workflow job identified by jobid.
jobid is the unique id of a workflow job attributename is the name of a process attribute |
|
|
|
|
Examples: |
set MYATTR = getprocessattribute
( TASKS-JOB_ID, 'REFERENCE_NO' ); |
|
Syntax: |
getsessionvariable(string) |
|
|
|
|
Description: |
Returns the HTTP session variable with the name of string. Returns a zero length string if the session variable does not exist. Objects are returned as a String by invoking their toString() method. Note that session variables cannot be accessed when a form is running in batch mode.
See support for multiple sessions for more information on http sessions and form sessions. See also function setsessionvariable. |
|
|
|
|
Examples: |
set USER_GROUP = getsessionvariable
( 'USERGROUP' ); |
|
Syntax: |
getufskey(string) |
|
|
|
|
Description: |
Returns an encrypted value of the string. See encrypting form parameters. |
|
|
|
|
Examples: |
set ENCRYPTED_VALUE = getufskey(CUSTOMER_ID); |
|
Syntax: |
hascredential(string1, string2) |
|
|
string1 -
credential name string2 – credential value |
|
Description: |
Returns true or false to indicate whether the user has the credential with the specified value. |
|
|
|
|
Examples: |
if [ !hasCredential('Department',
'Finance') ]
message 'Access denied – only finance users allowed'; endif |
|
Syntax: |
hasrole(string) |
|
|
|
|
Description: |
Returns true or false to indicate whether the current signed on user has the required role. Returns false if no signed on user exists. |
|
|
|
|
Examples: |
if [ !hasRole('SUPERVISOR'
) ]
message 'Access denied'; endif |
|
Syntax: |
instring(string1, string2) instring(string1, string2, startPos)
string1 -
search string string2 – containing string startPos - offset within string2 to start the search |
|
|
|
|
Description: |
Returns the position (starting from 1) of the first occurrence of string1 in string2. If string1 is not found, returns -1. If startPos is specified, it indicates the offset within string2 to start the search, where 1 represents the first character (0 is invalid and will generate an error). If specified, startPos should be a field of type INTEGER. All three parameters can be specified as form fields. Note that the search is case sensitive. To perform a case insensitive search, use the uppercase function as well e.g. set POS = instring ( uppercase(SEARCH_ARG), uppercase(SEARCH_STRING)); |
|
|
|
|
Examples: |
set F2 = instring('A','CAR');
// (result F2 = 2) set F2 = instring('B','CAR');
// (result F2 = -1) set POS = instring
( 'e', 'ebase technology',
6); //(result POS = 8) |
isauthorised
!!
THIS COMMAND IS DEPRECATED AS OF EBASE V3.4.0. Use isauthorized()
instead.
|
Syntax: |
isauthorised(string1, string2, string3)
String1 is the authorization Type String2 is the authorization Name String3 is the authorization Function |
|
|
|
|
Description: |
Returns either Y or N to indicate whether the current signed on user has the required authorization. Returns N if no signed on user exists. See Ebase Security Authorizations for more information. |
|
|
|
|
Examples: |
set ALLOWED = isauthorised('CUSTOMER',
CUSTOMER_NAME, 'Update'); if [ ALLOWED != 'Y' ]
message 'Access denied'; endif |
|
Syntax: |
isauthorized(string1, string2, string3)
String1 is the authorization Type String2 is the authorization Name String3 is the authorization Function |
|
|
|
|
Description: |
Returns true or false to indicate whether the current signed on user has the required authorization. Returns false if no signed on user exists. See Ebase Security Authorizations for more information. |
|
|
|
|
Examples: |
if [ !isauthorized('CUSTOMER',
CUSTOMER_NAME, 'Update' ) ]
message 'Access denied'; endif |
|
Syntax: |
isvalueinlist(string1, string2) |
|
|
string1 -
value string2 – comma delimited list of values |
|
Description: |
Returns true or false to indicate whether the value is in the list |
|
|
|
|
Examples: |
if [ !isvalueinlist(COUNTRY,
'
message 'country not supported'; endif |
|
Syntax: |
joindatetime( date_field, time_field )
date_field is a field of type DATE time_field is a field of type TIME |
|
|
|
|
Description: |
Joins a field a type
DATE with a field of type TIME to create a field of type DATETIME. |
|
|
|
|
Examples: |
set datetime1 = joindatetime(date1,
time1); //(datetime1
is a field of type DATETIME) |
|
Syntax: |
length(string) |
|
|
|
|
Description: |
Returns the length of string as an integer.
|
|
|
|
|
Examples: |
if [length(ADDRESS) > 10] ........ |
|
Syntax: |
lowercase(string)
|
|
|
|
|
Description: |
Returns string converted to lower case. |
|
|
|
|
Examples: |
if [lowercase(INSURANCE_TYPE) = 'health' ] ........ |
|
Syntax: |
movefile(src, dest)
src is a string or the name of a form field or a system variable containing the full path to the source file location on the server. dest is a string or the name of a form field or a system variable containing the full path to the destination file location on the server. |
|
|
|
|
Description: |
Returns true if the source file is moved successfully to the destination. Otherwise returns false. |
|
|
|
|
Examples: |
if [movefile('c:/ebase/UfsServer/generatedfiles/expenses.xls',
'c:/expenses/expenses_01.xls')] ........ upload; if [movefile($FILE_NAME,
DEST)] ........ |
|
Syntax: |
replace(string1, string2, string3)
string1 is the target string string2 is the search string string3 is the replace string |
|
|
|
|
Description: |
Replaces all occurrences of string2 in string1 with string3. String2 can contain a regular expression. |
|
|
|
|
Examples: |
//
Replace all occurrences of cat with dog in PETS. set
PETS = replace(PETS, 'cat', 'dog'); |
|
Syntax: |
replacelinefeeds(string1) |
|
|
|
|
Description: |
Removes leading and trailing white space, carriage return/line feed and tab characters from string1. Replaces each intervening carriage return/line feed and tab character by a single space. |
|
|
|
|
Examples: |
set F1 = replacelinefeeds(F2); |
|
Syntax: |
round(number1); round(number1, number2); |
|
|
|
|
Description: |
The first case returns the numerical value of number1 rounded to the nearest integer.
The second case returns the numerical value of number1 rounded to the number of decimal points specified in number2. |
|
|
|
|
Examples: |
set ROUNDED_NUMBER = round(DECIMAL_NUMBER,
2); |
|
Syntax: |
setcookie(name, value, age)
name is a string specifying the name of the cookie. value the value of the cookie. age is the maximum age of the cookie in seconds. |
|
|
|
|
Description: |
Sets the value of a cookie for this user. Returns 'OK' if the cookie is set or 'ERROR' if the cookie could not be set. This value will not be available to getcookie until the next request. The name should only contain ASCII alphanumeric characters and cannot contain commas, semicolons, or white space or begin with a $ character. See also function getcookie. |
|
|
|
|
Examples: |
// add a cookie called USER, set with the
value of field USER_NAME. This cookie is set to expire in 364 days. set STATUS = setcookie
( 'ACMESIGNON', USER_NAME, 31449600); |
|
Syntax: |
|
|
|
|
|
Description: |
Sets the form session variable string1 with the value in string2. All values are saved as type String. Returns 'OK' if the variable is set or 'ERROR' if the variable could not be set. Note that form session variables cannot be set when a form is running in batch mode.
See support for multiple sessions for more information on form sessions. See also function getformsessionvariable. |
|
|
|
|
Examples: |
set STATUS = setformsessionvariable
( 'VAR1', 'Value 1' ); |
|
Syntax: |
|
|
|
|
|
Description: |
Sets the HTTP session variable string1 with the value in string2. All values are saved as type String. Returns 'OK' if the variable is set or 'ERROR' if the variable could not be set. Note that session variables cannot be set when a form is running in batch mode.
See support for multiple sessions for more information on http sessions and form sessions. See also function getsessionvariable. |
|
|
|
|
Examples: |
set STATUS = setsessionvariable
( 'USERGROUP', 'GROUP1' ); |
|
Syntax: |
settablerow( table_name, table_column_name, value )
table_name is the name of the table table_column_name is the name of the table column to be compared with value value is any string
Please note that table_name and table_column_name
should both be specified in quotes as shown in the example below. |
|
|
|
|
Description: |
Sets the current row of table table_name by looping through the table and comparing the value of table_column_name with value. The current row is set on the first occurrence that matches. Returns 'OK' if the current row was set or 'NOT SET' if no match was found. This function can be used in conjunction with function buildlistfromtable. (See Table Concepts and Capabilities for more information). |
|
|
|
|
Examples: |
set STATUS = settablerow(
'CUSTTAB', 'CUSTTAB-NAME', 'Acme Corp' ); |
|
Syntax: |
splitdate( datetime_field )
datetime_field is a field of type DATETIME |
|
|
|
|
Description: |
Sets a field of type DATE with the date portion of a DATETIME field. See also function splittime. Currently, if the originating datetime field is null, the destination date field will be 01/01/1970. |
|
|
|
|
Examples: |
set date1 = splitdate(datetime1); |
|
Syntax: |
splittime( datetime_field )
datetime_field is a field of type DATETIME |
|
|
|
|
Description: |
Sets a field of type TIME with the time portion of a DATETIME field. See also function splitdate. Currently, if the originating datetime field is null, the destination time field will be 00:00 (i.e. midnight). |
|
|
|
|
Examples: |
set time1 = splitdate(datetime1); |
|
Syntax: |
startswith(string1, string2) |
|
|
|
|
Description: |
Returns true if string1 starts with string2. Otherwise returns false. |
|
|
|
|
Examples: |
if [startswith
(PRODUCT, 'X') ] ........ |
|
Syntax: |
substring(string, offset, number)
string is the source string offset is an integer specifying an offset into string number is an integer specifying the number of characters to return, and must be greater than 0 |
|
|
|
|
Description: |
Returns a substring of string. In the first format, returns number characters of string starting from position offset. In the second format, returns all characters of string starting from position offset.
Please note that the first character in a string is denoted by an offset value of 1, not 0.
This function
will tolerate an offset or count which is not within the range of
string, and will then return the
substring that most closely matches the request. The function will not abort
if either offset or number reference a location outside of
string. See the examples below. |
|
|
|
|
Examples: |
set CHARS_3TO6 = substring(PRODUCT,3,4); // When PRODUCT contains ‘Widgets’, returns
‘dget’. set PET = substring('Alligator', 5); // Returns ‘gator’. set A = substring('abc',
1, 5); // Returns ‘abc’. set A = substring('abc',
3, 5); // Returns ‘c’. set A = substring('abc',
4, 5); // Returns an empty string. set F1 = substring( tostring(F1),1,3); // For when the field F1 is an integer
field. |
|
Syntax: |
|
|
|
|
|
Description: |
Returns a string representing time1. |
|
|
|
|
Examples: |
set
string1 = timetostring(START_TIME); |
|
Syntax: |
tostring(number1) |
|
|
|
|
Description: |
Returns the string value of the numeric field number1. See also datetostring and timetostring functions. |
|
|
|
|
Examples: |
set COMMENTS = 'There are ' + tostring(count) + ' records in this set'; |
|
Syntax: |
trim(string1) |
|
|
|
|
Description: |
Removes leading and trailing white space from string1. |
|
|
|
|
Examples: |
set WORK1 = trim(LAST_NAME); |
|
Syntax: |
uppercase(string1) |
|
|
|
|
Description: |
Returns string1 converted to upper case. |
|
|
|
|
Examples: |
if [uppercase(INSURANCE_TYPE) = 'HEALTH' ] ........ |
|
Syntax: |
urldecode(value[,decoding])
value is the value to URL decode. decoding (optional) type of URL decoding e.g ‘UTF-8’. The default decoding is ‘ISO-8859-1’ if the decoding is not supplied. |
|
|
|
|
Description: |
Returns value URL decoded. This function should be used to decode any values that are URL encoded. |
|
|
|
|
Examples: |
set DECODED_VALUE = urldecode(ENCODED_VALUE); set DECODED_VALUE = urldecode(ENCODED_VALUE,
‘UTF-8’); |
|
Syntax: |
urlencode(value[,encoding])
value is the value to URL encode. encoding (optional) type of URL encoding e.g ‘UTF-8’. The default encoding is ‘ISO-8859-1’ if the encoding is not supplied. |
|
|
|
|
Description: |
Returns value URL encoded. This function should be used when a value requires URL encoding. |
|
|
|
|
Examples: |
set ENCODED_VALUE = urlencode(PARAM1); set ENCODED_VALUE = urlencode(PARAM1,
‘UTF-8’); |
A number of additional functions are shipped with Ebase, but have not been added to the functions table. These can be added if required.