FPL Script Command Syntax

Documentation home

 

General notes on syntax. 4

Expressions 5

Value Expressions 5

Arithmetic calculations and rounding. 6

Date and Time field arithmetic 6

Date and Time literals 7

Date literals 7

Time literals 7

Datetime literals 7

Environment variables 7

Field and Table properties 7

Control Properties 9

Handling script errors 9

Script commands 9

abort 9

break. 9

call 10

callscript 10

call url 11

call form.. 12

commit 13

copytable. 13

delete. 14

deleterow. 14

display. 14

exec 15

fetch. 16

fetchtable. 16

goto form.. 17

goto page. 17

goto url 18

hide button. 18

hide column. 19

hide control 20

hide field. 20

hide group. 21

highlight 21

if/else. 22

insert 23

insertrow. 23

interpret 23

lock. 24

log. 24

loop. 25

loop at 25

message. 26

PDFPrint 27

print 28

read. 28

return. 29

resettable. 29

returnfrom form.. 29

rollback. 30

sendmail 30

sequence. 31

set button hidden. 31

set button value. 32

set column displayonly/hidden/mandatory. 33

set control property value. 33

set control displayonly/hidden/mandatory/hyperlink. 34

set field value. 34

set field displayonly/hidden/mandatory/hyperlink. 35

set group displayonly/hidden/mandatory. 36

set JSP. 36

set nextpage. 37

set table. 37

set template. 38

set text 38

setfocus 39

setrow. 39

show button. 40

show column. 41

show control 41

show field. 41

show group. 42

sort 43

unhighlight 43

unlock. 44

unset button hidden. 44

unset column displayonly/hidden/mandatory. 45

unset control displayonly/hidden/mandatory/hyperlink. 46

unset field displayonly/hidden/mandatory/hyperlink. 46

unset group displayonly/hidden/mandatory. 47

unsetrow. 48

update. 48

upload. 49

updatetable. 49

workflow. 50

write. 50

System variables 50

$ABORT_MESSAGE. 51

$ABORT_PAGE. 51

$BACK_BUTTON_FROM_FORM. 51

$BACK_BUTTON_FROM_PAGE. 51

$BACK_BUTTON_SUPPORTED. 51

$BACK_BUTTON_TO_PAGE. 51

$BACK_BUTTON_USED. 51

$BATCH_MODE. 51

$BROWSER_IP_ADDRESS. 51

$BROWSER_TYPE. 51

$BROWSER_SUPPORTS_COOKIES. 52

$BROWSER_SUPPORTS_JAVASCRIPT. 52

$BROWSER_SUPPORTS_STYLESHEETS. 52

$COMMAND_STATUS. 52

$COMPONENT_PREFIX. 52

$CURRENT_PAGE. 52

$DATABASE. 52

$ESESSION_ID. 52

$FETCH_COUNT. 52

$FILE_NAME. 53

$FILE_NAME_USER. 53

$FORMID. 53

$FOUND. 53

$GLOBAL_HTML_FORM. 53

$LANGUAGE. 53

$NEXT_PAGE. 53

$NEXT_SEQUENCE_ID. 53

$PRESENTATION_USE_JAVASCRIPT. 53

$PRESENTATION_USE_STYLESHEETS. 54

$PRESENTATION_USE_POPUPS. 54

$PRESENTATION_USE_COLOUR. 54

$PRESENTATION_ZOOM_AMOUNT. 54

$PREVIOUS_PAGE. 55

$PROJECT. 55

$ROW_DELETED. 55

$ROW_EMPTY. 55

$ROW_INSERTED. 55

$ROW_SELECTED. 55

$SAVED_WORK_EXISTS. 55

$SESSION_ID. 55

$SYSTEM_DATE. 55

$SYSTEM_DATETIME. 55

$SYSTEM_NAME. 56

$SYSTEM_PREFERENCES_USE_JAVASCRIPT. 56

$SYSTEM_PREFERENCES_USE_POPUPS. 56

$SYSTEM_PREFERENCES_OPTION_COLOUR_BUTTON. 56

$SYSTEM_PREFERENCES_OPTION_ZOOM_BUTTON. 56

$SYSTEM_TIME. 56

$SYSTEM_TIME_NOW.. 56

$USER. 56

$USERVAR1,2,3. 57

$UFS_REQUEST_URL 57

$UFS_RETURN_URL 57

$UFS_SERVER_NAME. 57

$WF_JOB_ID. 57

$WF_TASK_ID. 57

$WEB_SERVICE_OPERATION. 57

$INTEGRATION_CALL_SOURCE. 57

$JMS_MESSAGE_ID. 58

$JMS_COLLABORATION_ID. 58

System supplied functions 58

addmonth. 58

addresslookup. 58

addressidlookup. 59

addweek. 59

addyear 59

buildlist 59

buildlistfromtable. 60

condense. 60

contains 60

datepart 60

datetostring. 61

dayofweek. 61

elementexists 62

encrypt 62

endswith. 62

fileexists 63

formatdate. 63

formattemplate. 64

getcookie. 64

getcredential 64

getformsessionvariable. 65

getlistdisplayvalue. 65

getprocessattribute. 65

getsessionvariable. 65

gettext 66

getufskey. 66

hascredential 66

hasrole. 67

instring. 67

isauthorized. 68

isvalueinlist 68

joindatetime. 68

length. 69

lowercase. 69

movefile. 69

osfiles 70

replace. 70

replacelinefeeds 70

round. 70

setcookie. 71

setformsessionvariable. 71

setsessionvariable. 71

settablerow. 72

settablerowvisible. 72

splitdate. 73

splittime. 73

startswith. 73

substring. 73

timetostring. 74

tostring. 75

trim.. 75

uppercase. 75

urldecode. 75

urlencode. 75

Additional supplied functions 76

 

 

See also: Custom functions.

 

General notes on syntax

 

·         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)

·         Comments may be inserted anywhere in a script. A comment starts with //. The rest of the line is ignored

·                                      

Expressions

 

Two types of expressions are supported:

 

Conditional Expressions

 

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 ]

 

Value Expressions

 

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;

 

Arithmetic calculations and rounding

 

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.

 

Date and Time field arithmetic

 

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.

 

Date and Time literals

 

Date literals

 

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

 

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

 

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

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.

 

 

Field and Table properties

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. Field and table 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. This property is read only.

currentRow

This property contains the internal row number of the table and is both read/write. See programming with row numbers for more details.

 

See also the set table command for additional table display properties that can be set.

 

The following read only field properties are available:

 

Property

Description

name

Field name

type

Field type. This will be one of the following:

BOOLEAN
CHAR

CURRENCY

DATE

DATETIME

INTEGER

NUMERIC

TIME

presentationType

Field presentation type. This will be one of the following:

BUTTON
CHECKBOX

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.

 

 

Control Properties

Most control properties can be accessed using syntax controlname.propertyname. See Accessing Control Properties from FPL for details. Details of property names and types can be found in the documentation for each control.

 

 

Handling script errors

 

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

 

 

Script commands

 

abort

 

Syntax:

abort [ expression ];

 

 

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

 

break

 

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

 

 

call

 

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

 

callscript

 

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

 

 

call url

 

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

 

See also goto URL and display.

 

 

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

 

 

call form

 

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.

 

 

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

commit

 

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

 

copytable

 

Syntax:

copytable SOURCE_TABLE [ to ] TARGET_TABLE;

 

 

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.

 

 

Examples:

copytable T1 to T2;

 

$COMMAND_STATUS:

OK

- command executed successfully

 

delete

 

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

  

deleterow

 

Syntax:

deleterow;

deleterow TABLE ROWID;

 

 

TABLE is the name of a table in the form

ROWID is the internal row number of a row and can be either an integer literal or a field or table column of type INTEGER (see programming with row numbers for more details)

 

Description:

deletes a row in a table. When used without any parameters, it deletes the current row in the current table and this form of the command can only be used within a loop at table construct or in a before control, validation or on click table cell event. 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.

 

 

Examples:

loop at table EXPENSES

   if [ AMOUNT = 0 ]

      deleterow;

   endif

endloop

 

deleterow EMPLOYEES ROW_ID_FIELD;

 

$COMMAND_STATUS:

OK

- command executed successfully

 

display

 

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

 

exec

 

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

 

fetch

 

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

 

fetchtable

 

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.

 

$FETCH_COUNT contains the number of records returned by the external resource after issuing fetchtable

 

 

Examples:

fetchtable CUSTOMERS;

 

$COMMAND_STATUS:

OK

- command executed successfully

 

goto form

 

Syntax:

goto form FORMNAME [parm1=value1, parm2=value2.......];

goto form expression [parm1=value1, parm2=value2.......];

 

FORMNAME is the name of the new form to be run

expression can only consist of a single 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

 

 

 

Description:

terminates execution of the current form, committing the current transaction, and begins execution of the new form. The form memory is freed, and navigation back to the form using the browser back button is not possible.

 

 

Examples:

goto form PRODUCT_DETAIL PRODUCT_ID=PRODUCT_ID,NEWITEM=Y;

 

if [ ..... ]

   set TARGET_FORM = 'NEWFORM1';

else

   set TARGET_FORM = 'NEWFORM2';

endif

goto form TARGET_FORM;

 

$COMMAND_STATUS:

OK

- command executed successfully

 

goto page

 

Syntax:

goto page PAGENAME;

goto page expression;

 

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.

 

 

Examples:

goto page ITEM_DETAIL;

 

set PAGE_FLAG = 'ITEM_DETAIL';

goto page PAGE_FLAG;

 

$COMMAND_STATUS:

OK

- command executed successfully

 

goto url

 

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

 

hide button

 

Syntax:

hide BUTTON_NEXTPAGE [ on PAGENAME];

hide BUTTON_PREVIOUSPAGE [ on PAGENAME];

hide BUTTON_FINISH;

hide BUTTON_SAVE;

hide 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 not appear on the page. These commands affect the visibility of the built-in page sequencing and save/restore buttons when these buttons are included on a page using a Legacy Button Control or one of the specific paging or save/restore Button Controls. These commands override the system default processing for the display of these 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 Page Sequencing for more information on the built-in page sequencing buttons.

See Save/Restore for more information on the save/restore feature.

 

This command is equivalent to command set BUTTONNAME [ on PAGENAME] HIDDEN.

 

 

Examples:

hide BUTTON_PREVIOUSPAGE HIDDEN;

hide BUTTON_PREVIOUSPAGE on Page_2 HIDDEN;

hide BUTTON_SAVE HIDDEN;

 

$COMMAND_STATUS:

OK

- command executed successfully

 

hide column

 

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

 

hide control

 

Syntax:

hide CONTROLNAME [ on PAGENAME];

 

CONTROLNAME is the name of the control

PAGENAME is the name of the page containing the table

 

if on PAGENAME is omitted, the control is assumed to be on the current page

 

 

Description:

hides the specified control and all its children. Note that a control is considered to be hidden if the control itself or any of its parents are hidden.

 

(see show control command for the reverse process)

 

 

Examples:

hide FIELDCONTROL1;

hide ORDERS_PANEL on P12;

 

$COMMAND_STATUS:

OK

- command executed successfully

hide field

 

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 and is supported only for forms upgraded from Version 3. 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

 

If FIELDNAME is not found, the command is processed as hide control.

 

(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

 

hide group

This command is deprecated from Version 4.0, use hide control command instead. The command is supported only for forms upgraded from Ebase Version 3.

 

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

 

highlight

 

Syntax:

highlight FIELDCONTROLNAME [ on PAGENAME ] CLASS;

highlight FIELD FIELDNAME [ : id ] [ on PAGENAME ] CLASS;

highlight ROW CLASS;

highlight ROW TABLE ROWID CLASS;

highlight TABLECELL COLUMNNAME CLASS;

 

FIELDCONTROLNAME is the name of a Field Control; note that this command cannot be used with other controls. The command is assumed to be of the type highlight FIELDCONTROLNAME if the second word is not FIELD, ROW or TABLECELL.

FIELDNAME is the name of any field in the form.

PAGENAME is the name of the page containing the control or field. If omitted, the control or field is assumed to be on the current page.

Id is the numerical field identifier and is supported only for forms upgraded from Version 3. 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.

TABLE is the name of a table in the form.

ROWID is the internal row number of a row and can be either an integer literal or a field or table column of type INTEGER (see programming with row numbers for more details).

CLASS is the name of a CSS class to be applied. This can be any class available in an associated style sheet.

 

 

Description:

applies the specified CSS class to the specified field control, field, table row or individual table cell. The highlight tablecell and highlight row (with no parameters) commands are interpreted as applying to the current row of the current table and can only be issued when a table context applies i.e. within a loop at table....endloop construct or when processing a before control, validation or on click event for a table or table cell. The unhighlight command can be used to remove a highlighting class.

 

 

Examples:

highlight FIELDCONTROL1 errorstyle;

highlight field FIELD_1 WARNING;

highlight field FIELD_2 on LAST_PAGE WARNING;

highlight field DUPLICATED_FIELD : 120 ALERT;

highlight row RED;

highlight row ORDERS ROW_ID_FIELD RED;

highlight tablecell T-COL1 BOLD;

 

$COMMAND_STATUS:

OK

- command executed successfully

 

if/else

 

Syntax:

if [ expression ]

    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

 

insert

 

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

              

insertrow

 

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.

 

 

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.

 

 

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

 

interpret

 

Syntax:

interpret expression;

 

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 CONTROL_NAME = 'GROUPPANEL1';

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.

 

lock

 

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

log

 

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

 

loop

 

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

 

 

loop at

 

Syntax:

loop at [TABLE] table_name

   commands;

endloop

 

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. The current row of the table remains set to the row at the point break is issued.

 

 

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

 

 

message

 

Syntax 1:

Syntax 2:

message type, messagenumber [,parm1, parm2, parm3 ......];

message 'text';

 

type can have three possible values :

  • E - Error message
  • W - Warning message
  • F - Final page message

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 be issued from all events other than form-level events. When an error message is issued from a validation event or any type of immediate event (e.g. on click, after page), 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 be issued from all events other than form-level events. 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 1234 contains : Requested loan amount £&& is below the minimum of £30000)
  • LOAN_AMOUNT field entered by the user is 15000      

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

 

PDFPrint

 

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

 

print

 

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

 

read

 

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)

 

return

 

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

 

resettable

 

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.

 

 

Examples:

resettable T1;

 

$COMMAND_STATUS:

OK

- command executed successfully

 

returnfrom form

 

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

 

rollback

 

Syntax:

rollback;

 

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

 

sendmail

 

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:

  • checked: the form will fail
  • unchecked: the form will continue to execute, the sendmail command will return with status ERROR, and the error will be logged

 

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)

 

sequence

 

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

 

 set button hidden

 

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 affect the visibility of the built-in page sequencing and save/restore buttons when these buttons are included on a page using a Legacy Button Control or one of the specific paging or save/restore Button Controls. These commands override the system default processing for the display of these 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 Page Sequencing for more information on the built-in page sequencing buttons.

See Save/Restore for more information on the save/restore feature.

 

(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

 

set button value

 

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

 

set column displayonly/hidden/mandatory

 

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

 

set control property value

 

Syntax:

set CONTROLNAME.propertyName = expression;

 

CONTROLNAME is the name of any control in the form.

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 value for the specified property. Property names and types (Character/Boolean/Integer) are provided in the documentation for each control. Nearly all control properties can be set using this command. See also Accessing Control Properties from FPL.

 

 

 $COMMAND_STATUS:

OK

- command executed successfully

set control displayonly/hidden/mandatory/hyperlink

 

Syntax:

set CONTROLNAME [ on PAGENAME] DISPLAYONLY | HIDDEN | MANDATORY | HYPERLINK;

 

CONTROLNAME is the name of the control

PAGENAME is the name of the page containing the table

 

if on PAGENAME is omitted, the control is assumed to be on the current page

 

 

Description:

changes the display attributes for the specified control 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. This command can only be applied to Field Controls and Table Column Controls. However, when issued for a container control, all child controls are set as display only.

 

A control is considered to be display only if the control itself or any of its parents are display only.

 

HIDDEN

Control and all of its children are hidden.

 

A control is considered to be hidden if the control itself or any of its parents are hidden.

 

MANDATORY

Control must be entered by the user. This is only applicable for Field Controls and Table Column Controls.

HYPERLINK

Control is a hyperlink. This is only applicable for Field Controls and Table Column Controls.

 

(see the unset command for the reverse process)

 

Examples:

set FIELDCONTROL_1 HIDDEN;

set FIELDCONTROL_2 on LAST_PAGE DISPLAYONLY;

set FIELDCONTROL_3 MANDATORY;

 

$COMMAND_STATUS:

OK

- command executed successfully

set field value

 

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 field displayonly/hidden/mandatory/hyperlink

 

Syntax:

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 and is supported only for forms upgraded from Version 3. 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.

 

DISPLAYONLY

data cannot be entered by the user. Dropdown lists, radio buttons and checkboxes will display the selected value as a text field.

HIDDEN

field will not appear on the page. If the field is a table cell, the cell’s contents are hidden.

MANDATORY

field must be entered by the user

HYPERLINK

field is a hyperlink

 

If FIELDNAME is not found, the command is processed as the corresponding set control command.

 

(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

 

set group displayonly/hidden/mandatory

This command is deprecated from Version 4.0, use corresponding set control command instead. The command is supported only for forms upgraded from Ebase Version 3.

 

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

 

DISPLAYONLY

data cannot be entered by the user. Dropdown lists, radio buttons and checkboxes will display the selected value as a text field.

HIDDEN

fields will not appear on the page

MANDATORY

fields must be entered by the user

 

(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

 

set JSP

 

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

 

set nextpage

 

Syntax:

set nextpage PAGENAME;

 

PAGENAME is the name of the next page

 

 

Description:

sets the next page to be displayed when the user clicks a next page button. See Page Sequencing.

 

 

Examples:

set nextpage PRODUCT_DETAIL;

 

$COMMAND_STATUS:

OK

- command executed successfully

 

set table

 

Syntax:

set table [ ON PAGENAME ] TABLENAME.PROPERTYNAME = expression;

 

PAGENAME the name of the page containing the table

TABLENAME is the name of the table.

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:

 

Property

Description

Accepted values

numrows

Number of displayed rows

integer > 0

columnHeaders

Whether column headers are displayed

true | false

displayInfo

Whether the no. records informational message is displayed

true | false

supportsAddRow

Whether the Add Row button is displayed

true | false

supportsDeleteRow

Whether the Delete column is displayed

true | false

supportsSelectRow

Whether the Select column is displayed

true | false

 

When the numrows property is set, the scroll position is reset to the top of the table.

 

Note that these properties (and many additional table properties) can also be set using the set control property command against the appropriate Table Control.

 

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

 

set template

 

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

 

set text

 

Syntax:

set text textid1 = 'text';

set text textid1 = textid2;

 

textid1, textid2 are text ids

'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 control texts can also be set using the set control property command. See Working With Texts for further details.

 

 

Examples:

set text TXT101 = 'Your answer is not clear - please provide additional details';

set text TXT99 = TXT1234;

 

$COMMAND_STATUS:

OK

- command executed successfully

 

setfocus

 

Syntax:

setfocus CONTROLNAME [ on PAGENAME ] [ ERROR ];

setfocus FIELDNAME [ : id ] [  [ in ] table TABLENAME ] [ on PAGENAME ] [ ERROR ];

setfocus $NULL [ on PAGENAME ];

 

CONTROLNAME is the name of the control

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 formatting should be applied

Id is the numerical field identifier and is supported only for forms upgraded from Version 3. 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 control or 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 control, 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.

 

The command looks first for a field named FIELDNAME; if this is not found, it then treats the command as setfocus CONTROLNAME.

 

 

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

 

setrow

 

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

 

show button

 

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 be shown on the page. These commands affect the visibility of the built-in page sequencing and save/restore buttons when these buttons are included on a page using a Legacy Button Control or one of the specific paging or save/restore Button Controls. These commands override the system default processing for the display of these 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 Page Sequencing for more information on the built-in page sequencing buttons.

See Save/Restore for more information on the save/restore feature.

 

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

 

show column

 

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

 

show control

 

Syntax:

show CONTROLNAME [ on PAGENAME];

 

CONTROLNAME is the name of the control

PAGENAME is the name of the page containing the table

 

if on PAGENAME is omitted, the control is assumed to be on the current page

 

 

Description:

makes the specified control visible. Note that a control is considered to be hidden if the control itself or any of its parents are hidden.

 

(see hide control command for the reverse process)

 

 

Examples:

show FIELDCONTROL1;

show ORDERS_PANEL on P12;

 

$COMMAND_STATUS:

OK

- command executed successfully

show field

 

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 and is supported only for forms upgraded from Version 3. 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

 

If FIELDNAME is not found, the command is processed as show control

 

(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

 

show group

This command is deprecated from Version 4.0, use show control command instead. The command is supported only for forms upgraded from Ebase Version 3.

 

 

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

 

sort

 

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

 

unhighlight

 

Syntax:

unhighlight FIELDCONTROL [ on PAGENAME ];

unhighlight FIELD FIELDNAME [ : id ] [ on PAGENAME ];

unhighlight ROW;

unhighlight ROW TABLE ROWID;

unhighlight TABLECELL COLUMNNAME;

unhighlight ALL;

 

FIELDCONTROLNAME is the name of a Field Control; note that this command cannot be used with other controls. The command is assumed to be of the type unhighlight FIELDCONTROLNAME if the second word is not FIELD, ROW or TABLECELL or 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 and is supported only for forms upgraded from Version 3. 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.

TABLE is the name of a table in the form.

ROWID is the internal row number of a row and can be either an integer literal or a field or table column of type INTEGER (see programming with row numbers for more details).

ALL indicates that all highlighting is removed from the current page.

 

 

Description:

removes any highlighting class from the specified control, field, table row or individual table cell. The unhighlight tablecell and unhighlight row (with no parameters) commands are interpreted as applying to the current row of the current table and can only be issued when a table context applies i.e. within a loop at table....endloop construct or when processing a before control, validation or on click event for a table or table cell. This command reverses the effect of the highlight command.

 

 

Examples:

unhighlight FIELDCONTROL1;

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

 

unlock

 

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

                   

unset button hidden

 

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 be shown on the page. These commands affect the visibility of the built-in page sequencing and save/restore buttons when these buttons are included on a page using a Legacy Button Control or one of the specific paging or save/restore Button Controls. These commands override the system default processing for the display of these 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 Page Sequencing for more information on the built-in page sequencing buttons.

See Save/Restore for more information on the save/restore feature.

 

(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

 

unset column displayonly/hidden/mandatory

 

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 control displayonly/hidden/mandatory/hyperlink

 

Syntax:

unset CONTROLNAME [ on PAGENAME] DISPLAYONLY | HIDDEN | MANDATORY | HYPERLINK;

 

CONTROLNAME is the name of the control

PAGENAME is the name of the page containing the table

 

if on PAGENAME is omitted, the control is assumed to be on the current page

 

 

Description:

changes the display attributes for the specified control on the specified page and is the reverse of the corresponding set command.

 

DISPLAYONLY

Data can be entered by the user. This command can only be applied to Field Controls and Table Column Controls. However, when issued for a container control, display only is removed from all child controls.

 

Note that a control is considered to be display only if the control itself or any of its parents are display only.

 

HIDDEN

Control is displayed.

 

Note that a control is considered to be hidden if the control itself or any of its parents are hidden.

 

MANDATORY

Control will be treated as optional. This is only applicable for Field Controls and Table Column Controls.

HYPERLINK

Control is no longer a hyperlink. This is only applicable for Field Controls and Table Column Controls.

 

(see the set command for the reverse process)

 

Examples:

unset FIELDCONTROL_1 HIDDEN;

unset FIELDCONTROL_2 on LAST_PAGE DISPLAYONLY;

unset FIELDCONTROL_3 MANDATORY;

 

$COMMAND_STATUS:

OK

- command executed successfully

unset field displayonly/hidden/mandatory/hyperlink

 

Syntax:

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 and is supported only for forms upgraded from Version 3. 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.

 

DISPLAYONLY

data can be entered by the user

HIDDEN

field will be displayed on the page

MANDATORY

field will be treated as optional

HYPERLINK

field is no longer a hyperlink

 

If FIELDNAME is not found, the command is processed as the corresponding unset control command.

 

(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

 

unset group displayonly/hidden/mandatory

This command is deprecated from Version 4.0, use corresponding unset control command instead. The command is supported only for forms upgraded from Ebase Version 3.

 

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

 

unsetrow

 

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.

 

 

Examples:

loop at table ACCOUNTS

   if [ $ROW_SELECTED = 'Y' ]

      callscript PROCESS_SELECTION;

      unsetrow selected;    

   endif

endloop

 

$COMMAND_STATUS:

OK

- command executed successfully

 

update

 

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:

  • update was performed
  • optimistic locking was set to ‘No’, the update may have overwritten ‘changed’ data
  • optimistic locking was set to ‘Yes’ but no fetch was issued earlier, the update may have overwritten ‘changed’ data

 

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

 

upload

 

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

 

updatetable

 

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.

 

 

Examples:

updatetable CUSTOMERS;

 

$COMMAND_STATUS:

OK

- command executed successfully

workflow

 

see form workflow facilities.

 

write

 

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)

 

 

 

System variables

 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' ] ......

 

$ABORT_MESSAGE

 Contains the details of any runtime failure. After an abort command, contains the abort reason.

 

$ABORT_PAGE

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.

 

$BACK_BUTTON_FROM_FORM

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.

 

$BACK_BUTTON_FROM_PAGE

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.

 

$BACK_BUTTON_SUPPORTED

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.

 

$BACK_BUTTON_TO_PAGE

When the browser back button has been clicked, contains the name of the back button target page. This variable is read only.

 

$BACK_BUTTON_USED

Contains 'Y' or 'N' to indicate whether or not the user has just clicked the browser back button. This variable is read only.

 

$BATCH_MODE

Contains value 'Y' if the form is processing in batch mode, or 'N' if the form is being processed online.

 

$BROWSER_IP_ADDRESS

Contains the IP address of the requestor.

 

$BROWSER_TYPE

Contains the user-agent string from the HTTP header.

 

$BROWSER_SUPPORTS_COOKIES

Returns either 'Y' or 'N' to indicate whether the client browser is capable of supporting cookies.

 

$BROWSER_SUPPORTS_JAVASCRIPT

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.

 

$BROWSER_SUPPORTS_STYLESHEETS

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.

 

$COMMAND_STATUS

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.

 

$COMPONENT_PREFIX

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.

 

$CURRENT_PAGE

The page name for the current page.

 

$DATABASE

The name of the database to be used when dynamic databases have been specified. See using dynamic databases for more information.

 

$ESESSION_ID

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.

$FETCH_COUNT

After a fetch or fetchtable command, this variable contains the number of retrieved records.

 

$FILE_NAME

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.

 

$FILE_NAME_USER

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.

 

$FORMID

The name of the form.

 

$FOUND

After a fetch command or a dynamic list check, this variable contains Y or N to indicate whether a record was found.

 

$GLOBAL_HTML_FORM

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.

 

$LANGUAGE

The language code for the user's session. This variable can be updated to dynamically change the runtime language e.g.  See Internationalization.

 

set $LANGUAGE = 'NL';

 

$NEXT_PAGE

The page name for the next page.

 

$NEXT_SEQUENCE_ID

This is set by the sequence command and contains the next number from the specified sequence. See sequence command.

 

$PRESENTATION_USE_JAVASCRIPT

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.

 

$PRESENTATION_USE_STYLESHEETS

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.

 

$PRESENTATION_USE_POPUPS

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)

 

$PRESENTATION_USE_COLOUR

Use of this variable is deprecated starting from Version 4.0 and will always return a value of 'Y'

Indicates whether the colors 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 color. e.g.

 

set $PRESENTATION_USE_COLOUR = 'N';

 

(See Web Accessibility - Options and Attributes for more information)

 

$PRESENTATION_ZOOM_AMOUNT

Use of this variable is deprecated starting from Version 4.0 and will always return a value of 0.  

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)

 

$PREVIOUS_PAGE

The page name for the previous page.

 

$PROJECT

The name of the project containing the form.

 

$ROW_DELETED

Contains Y or N to indicate that the user has clicked the Delete checkbox for the current row of the table being processed.

 

$ROW_EMPTY

Contains Y or N to indicate that the current row of the table being processed is empty.

 

$ROW_INSERTED

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. 

$ROW_SELECTED

Contains Y or N to indicate that the user has clicked the Select checkbox for the current row of the table being processed. 

 

$SAVED_WORK_EXISTS

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.

 

$SESSION_ID

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.

 

$SYSTEM_DATE

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;

 

$SYSTEM_DATETIME

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;

 

$SYSTEM_NAME

Contains the system name as defined in UFSSetup.properties parameter Ufs.systemName. This variable is read only.

 

$SYSTEM_PREFERENCES_USE_JAVASCRIPT

Indicates the setting of the global Javascript flag, Contains 'Y' or 'N'.  (See Web Accessibility - Options and Attributes)

 

$SYSTEM_PREFERENCES_USE_POPUPS

Indicates the setting of the global window popup flag, Contains 'Y' or 'N'.  (See Web Accessibility - Options and Attributes)

 

$SYSTEM_PREFERENCES_OPTION_COLOUR_BUTTON

Use of this variable is deprecated starting from Version 4.0 .

Indicates the setting of the global color button flag, Contains 'Y' or 'N'.  (See Web Accessibility - Options and Attributes)

 

$SYSTEM_PREFERENCES_OPTION_ZOOM_BUTTON

Use of this variable is deprecated starting from Version 4.0.

Indicates the setting of the global zoom button flag, Contains 'Y' or 'N'.  (See Web Accessibility - Options and Attributes)

 

$SYSTEM_TIME

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. 

 

$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.

 

$USER

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)

 

$USERVAR1,2,3

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. An event 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.

 

$UFS_REQUEST_URL

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

 

$UFS_RETURN_URL

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;

 

$UFS_SERVER_NAME

Contains the hostname of the Ebase Server.

 

$WF_JOB_ID

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).

 

$WF_TASK_ID

Contains the unique workflow task id when the form is workflow’ed. (See form workflow facilities for more information).

 

$WEB_SERVICE_OPERATION

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).

 

$INTEGRATION_CALL_SOURCE

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.

 

$JMS_MESSAGE_ID

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.

 

$JMS_COLLABORATION_ID

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.

 

 

System supplied functions

 

The following is a list of system provided functions. Additional functions can be added to meet the needs of individual clients.

 

addmonth

 

Syntax:

addmonth(date1, number1, weekdaysonly)

 

 

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');

 

addresslookup

 

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');

 

addressidlookup

 

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');

 

addweek

 

Syntax:

addweek(date1, number1)

 

 

Description:

Adds the number of weeks specified by number1 to date1 and returns the new date.

 

 

Examples:

set NEWDATE = addweek(OLDDATE, 3);

 

addyear

 

Syntax:

addyear(date1, number1)

 

 

Description:

Adds the number of years specified by number1 to date1 and returns the new date.

 

 

Examples:

set = addyear(OLDDATE, 25);

 

buildlist

 

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');

 

buildlistfromtable

 

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.

 

 

Examples:

set NUMROWS = buildlistfromtable( 'CUSTOMERS_LIST', 'CUSTTAB', 'CUSTTAB-NAME', 'CUSTTAB-ID' );

 

condense

 

Syntax:

condense(string)

 

 

Description:

Returns string with all spaces removed.

 

 

Examples:

if [condense(NAME) = 'JohnBrown' ]

........

 

contains

 

Syntax:

contains(string1, string2)

 

 

Description:

Returns true if string1 contains string2. Otherwise returns false.

 

 

Examples:

if [ contains(USER_PREFERENCES, 'Caviar') ]

........

 

datepart

 

Syntax:

datepart(date1,string2)

 

date1 is a field of type DATE

string2 is a date part as follows:

 

Valid DateParts (string2)

YY  

two digit year

YYYY

four digit year

Q

quarter of the year

MM

two digit month

MMM

3 character month name i.e. Jan. Feb, Mar,  etc

MMMM

full month name i.e. January, February, March,  etc

WK

two digit week of year

DY

two digit day of year

DM

two digit day of month

WM

two digit week of month

DW

two digit day of week

DN

three character day name i.e. Mon, Tue, Wed, etc

DF

full day name i.e. Monday, Tuesday, Wednesday, etc

HH

two digit hour

MI

two digit minute

SS

two digit second

MS

Milliseconds

 

 

Description:

Returns a character string representing part of the date.

See also formatdate function.

 

 

Examples:

set RESULT = datepart($SYSTEM_DATE, 'Q');

 

datetostring

 

Syntax:

datetostring(date1 [,regionalFormatting])

 

date1 is the date field to format

regionalFormatting (optional) 'true' or 'false'.  If 'true' the return string formats according to the form's language setting.  If 'false' or unspecified, the system date format is used.

 

 

Description:

Returns a string, representing date1.

 

 

Examples:

// format the date using the system date format.
set string1 = datetostring(DOB);

// if language is specified as US_en format output will be mm/dd/yyyy.

set string1 = datetostring(DOB, 'true'); 
// formats date as datetostring(DOB), language setting is ignored.

set string1 = datetostring(DOB, 'false'); 

 

dayofweek

 

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']

.......

 

elementexists

 

Syntax:

elementexists (string1, string2)

 

string1 is an Ebase element type and must be either PRESENTATION_TEMPLATE or FORM

string2 is the element name

 

 

Description:

Returns ‘Y’ or ‘N’ to indicate whether the specified element exists.

 

 

Examples:

if [ elementexists('PRESENTATION_TEMPLATE', 'SPECIAL') = 'Y' ]

if [ elementexists('FORM', 'MY_FORM') = 'Y' ]

 

encrypt

 

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');

 

endswith

 

Syntax:

endswith(string1, string2)

 

 

Description:

Returns true if string1 ends with string2. Otherwise returns false.

 

 

Examples:

if [endswith (PRODUCT, 'OIL') ]

........

 

fileexists

 

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)]

........

 

 formatdate

 

Syntax:

formatdate(date1,string2)

 

date1 is a field of type DATE

string2 is a format string as follows:

 

Symbol

Meaning

Presentation

Example

G

era designator

Text

AD

Y

year

Number

1996

M

month in year

Number or Text

07 or July

d

day in month

Number

10

E

day in week

Text

Tuesday

D

day in year

Number

189

F

day of week in month

Number

2

w

week in year

Number

27

W

week in month

Number

2

 

Format String Examples:

 

dd/MM/YYYY                   -            10/07/1996

EEE MMMM dd, YYYY    -            Tue July 10, 1996

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');

 

formattemplate

 

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');

 

getcookie

 

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' );

 

getcredential

 

Syntax:

getcredential(string)

 

 

Description:

Returns the value of the named user credential.

 

 

Examples:

set EMAIL_ADDRESS = getcredential('email');

 

getformsessionvariable

 

Syntax:

getformsessionvariable(string)

 

 

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' );

 

getlistdisplayvalue

 

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' );

 

 

getprocessattribute

 

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' );

getsessionvariable

 

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' );

 

gettext

 

Syntax:

gettext(string1 [, string2] [,string3])

 

 

Description:

Returns a text.

 

 

string1 – text id

string 2 – optional namespace (must be one of 'Local', 'Shared' or 'System'). If not specified, the default is 'Local'.

string3 – optional language code (as defined in Internationalization Dialog). If not specified, the default is the form runtime language.

 

See Working with Texts for more details.

 

Examples:

set TEMPTEXT = gettext('TXT50');

set TEMPTEXT = gettext('SHR24', 'Shared');

set TEMPTEXT = gettext('TXT501', 'Local', 'FR');

 

getufskey

 

Syntax:

getufskey(string)

 

 

Description:

Returns an encrypted value of the string. See encrypting form parameters.

 

 

Examples:

set ENCRYPTED_VALUE = getufskey(CUSTOMER_ID);

 

hascredential

 

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

 

hasrole

 

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

 

instring

 

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

 

isauthorized

 

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

 

isvalueinlist

 

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, 'UK, Belgium, France, Germany, Holland, USA') ]

   message 'country not supported';

endif

 

joindatetime

 

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.
If the time field is either null or 0:0:0 the time is interpreted as midnight. If the date field is null, the destination datetime field will be set to null.

 

 

Examples:

set datetime1 = joindatetime(date1, time1);           //(datetime1 is a field of type DATETIME)

 

length

 

Syntax:

length(string)

 

 

Description:

Returns the length of string as an integer.

 

 

 

Examples:

if [length(ADDRESS) > 10]

........

 

lowercase

 

Syntax:

lowercase(string)

 

 

 

Description:

Returns string converted to lower case.

 

 

Examples:

if [lowercase(INSURANCE_TYPE) = 'health' ]

........

 

movefile

 

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)]

........

 

osfiles

 

Syntax:

osfiles(string1, string2)

 

string1 is a form field name and should designate a field type that can accept a list i.e. dropdown, radio button or checkbox

string2 is a folder or directory name and must end with a forward slash

 

 

Description:

Populates the list associated with the field designated by string1 with all files and folders in the folder or directory specified by string2. Returns the number of files and folders contained in the folder or directory.

 

 

Examples:

// populate a list for field FILE_LIST

set FILE_COUNT = osfiles('FILE_LIST', DIRNAME);

set FILE_COUNT = osfiles('FILE_LIST', 'C:/temp/');

 

 

replace

 

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');

 

replacelinefeeds

 

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);

 

round

 

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);

 

setcookie

 

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);

 

setformsessionvariable

 

Syntax:

setformsessionvariable(string1, string2)

 

 

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' );

 

setsessionvariable

 

Syntax:

setsessionvariable(string1, string2)

 

 

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' );

 

settablerow

 

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.
Please note that value must be a string. For example, if the column is a date column, you need to use the "datetostring" command.

 

 

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.

 

 

Examples:

set STATUS = settablerow( 'CUSTTAB', 'CUSTTAB-NAME', 'Acme Corp' );
set STATUS = settablerow( 'T1', 'T1-THREE', datetostring(DATE_FIELD_1));

 

settablerowvisible

 

Syntax:

settablerowvisible( table_name, table_column_name, value [, page] )

 

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

page is an optional page name (defaults to the current page if not specified)

 

Please note that table_name and table_column_name should both be specified in quotes as shown in the example below.
Please note that value must be a string. For example, if the column is a date column, you need to use the "datetostring" command.

 

 

Description:

Sets the current row of table table_name as described for function settablerow(), then scrolls the table so that the specified row is the first row displayed. Returns 'OK' if the current row was set or 'NOT SET' if no match was found.

 

 

Examples:

set STATUS = settablerowvisible( 'CUSTTAB', 'CUSTTAB-NAME', 'Acme Corp' );
set STATUS = settablerowvisible ( 'T1', 'T1-THREE', datetostring(DATE_FIELD_1));

 

splitdate

 

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);

 

splittime

 

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);        

 

startswith

 

Syntax:

startswith(string1, string2)

 

 

Description:

Returns true if string1 starts with string2. Otherwise returns false.

 

 

Examples:

if [startswith (PRODUCT, 'X') ]

........

 

substring

 

Syntax:

substring(string, offset, number)

substring(string, offset) 

 

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.

Note: this command only works with a character string, not with integers. To use for integers, use 'tostring'.

 

 

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.

 

 

timetostring

 

Syntax:

timetostring(time1)

time1 is the time field to format

 

 

Description:

Returns a string representing time1.

 

 

Examples:

set string1 = timetostring(START_TIME); 

 

tostring

 

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';

 

trim

 

Syntax:

trim(string1)

 

 

Description:

Removes leading and trailing white space from string1.

 

 

Examples:

set WORK1 = trim(LAST_NAME);

 

uppercase

 

Syntax:

uppercase(string1)

 

 

Description:

Returns string1 converted to upper case.

 

 

Examples:

if [uppercase(INSURANCE_TYPE) = 'HEALTH' ]

........

 

urldecode

 

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’);

 

urlencode

 

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’);

 

 

Additional supplied functions

 

A number of additional functions are shipped with Ebase, but have not been added to the functions table. These can be added if required.