Additional Supplied Functions
This document contains details of additional functions that have been developed to meet the needs of individual customers. The Java code for these functions is shipped with the standard Ebase product, but the functions have not been added to the functions table (Server Admin App -> Home -> FPL Functions). They can be added as required. For each function, the implementation section describes the parameters required to add the function to the system using (Server Admin App -> Home -> FPL Functions) and these can be cut and pasted into the functions dialog. The functions are then immediately available for use.
These functions are supported by Ebase on a best efforts basis.
Please note that the Quick Address system must be installed and the proweb.jar file available on the Ebase classpath to use this function.
Syntax: |
addresslookupqa (string1, string2) |
|
|
Description: |
This function is used to perform 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
= addresslookupqa(POSTCODE, 'ADDRESSES'); |
|
|
Implementation: |
please contact Ebase support support@ebasetech.com for
implementation details. |
Please note that the Quick Address system must be installed and the proweb.jar file available on the Ebase classpath to use this function.
Syntax: |
addressidlookupqa (string1, string2, string3, string4, string5, string6, string7, string8) |
|
|
Description: |
This function is used to perform Returns the number of addresses (always 1) for address id string1.string2 , string3, string4, string5, string6, string7, string8 must be a literals containing names of form fields of display type text.Populates form fields represented by string2 , string3, string4, string5, string6, string7, string8 with address line 0, address line 1, address line 2, address line 3, town, county and postcode respectively for address id string1. |
|
|
Examples: |
set DUMMY = addressidlookupqa(ADDRESS_ID, 'LINE_0', 'LINE_1',
'LINE_2', 'LINE_3', 'TOWN', 'COUNTY', 'POSTCODE'); |
|
|
Implementation: |
please contact Ebase support support@ebasetech.com for
implementation details. |
Syntax: |
deletefile(fullpath_filename_ext) |
||||||||||||||||
|
|
||||||||||||||||
Description: |
Deletes a file from a given folder |
||||||||||||||||
|
|
||||||||||||||||
Examples: |
set
FULLPATH_FILENAME_EXT = 'c:/temp/MyTest.txt'; set STATUS = deletefile(FULLPATH_FILENAME_EXT); |
||||||||||||||||
|
|
||||||||||||||||
Implementation: |
|
Syntax: |
getActionField() |
||||||||||
|
|
||||||||||
Description: |
Returns the name of the field that triggered the current processing. This is only applicable for immediate validation fields, buttons and hyperlinks. Note that in the particular case when the current processing was triggered by an event associated with a table column e.g. hyperlink, button etc, and a fetchtable FPL command is issued against the table as part of this processing, this function will return null. |
||||||||||
|
|
||||||||||
Examples: |
set ACTION_FIELD =
getActionField(); |
||||||||||
|
|
||||||||||
Implementation: |
|
Syntax: |
getActionTableRow() |
||||||||||
|
|
||||||||||
Description: |
Returns the row number corresponding to the control that triggered the current processing when the control is inside a Table Control or a Repeater Control. Returns -1 if processing is not triggered by a control associated with a table row. |
||||||||||
|
|
||||||||||
Examples: |
set ROW_NUM = getActionTableRow(); |
||||||||||
|
|
||||||||||
Implementation: |
|
Syntax: |
getCallingForm() |
||||||||||
|
|
||||||||||
Description: |
Returns the name of the form that called the current form. |
||||||||||
|
|
||||||||||
Examples: |
set CALLING_FORM =
getCallingForm(); |
||||||||||
|
|
||||||||||
Implementation: |
|
Syntax: |
getMessageText(project, message_number [, parm1, parm2,…] ) project is the name of the project containing the message message_number is the number of the message parm1, parm2 etc are variables to be substituted into the message text replacing && strings |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Description: |
Returns a message text with any variables substituted. In a multi-lingual system, the same rules are applied to select the language as are used to display a text using the FPL message command. |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Examples: |
set TEXT1 = getMessageText($PROJECT, 1007); set TEXT2 = getMessageText('GLOBAL', 10000, POSTCODE, CITY); |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Implementation: |
|
Syntax: |
getmilisecBTD(DATE1,DATE2) |
|||||||||||||||||||
|
|
|||||||||||||||||||
Description: |
Returns the milliseconds between two dates Where DATE1 and DATE2 are fields of type date |
|||||||||||||||||||
|
|
|||||||||||||||||||
Examples: |
set DATE1 =
'01/09/2006'; set DATE2 =
'05/09/2006'; set STATUS = getmilisecBTD(DATE1,DATE2); |
|||||||||||||||||||
|
|
|||||||||||||||||||
Implementation: |
|
Syntax: |
getmilisecs() |
||||||||||
|
|
||||||||||
Description: |
Returns the milliseconds of the current time |
||||||||||
|
|
||||||||||
Examples: |
set MILISECS = getmilisecs(); |
||||||||||
|
|
||||||||||
Implementation: |
|
Syntax: |
isCalledForm() |
||||||||||
|
|
||||||||||
Description: |
Returns Y or N to indicate that the current form has been called using CALL FORM. |
||||||||||
|
|
||||||||||
Examples: |
if [ isCalledForm() = 'Y' ] |
||||||||||
|
|
||||||||||
Implementation: |
|
Syntax: |
isUserInGroup(userid, groupid) |
|||||||||||||||||||
|
|
|||||||||||||||||||
Description: |
Returns true or false to indicate whether a user is in a security group. |
|||||||||||||||||||
|
|
|||||||||||||||||||
Examples: |
if [ isUserInGroup(
$USER, GROUPNAME ) ) … |
|||||||||||||||||||
|
|
|||||||||||||||||||
Implementation: |
|
Syntax: |
requestProperty(property) |
||||||||||||||||
|
|
||||||||||||||||
Description: |
Returns information about the HTTP request |
||||||||||||||||
|
|
||||||||||||||||
Examples: |
set IPADDRESS = requestProperty(‘remoteAddr’); |
||||||||||||||||
|
|
||||||||||||||||
Implementation: |
|
Syntax: |
runScheduledEvent(fullpath_filename_ext) |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
Description: |
Executes a scheduler event via a trigger |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
Examples: |
set RESP = runscheduleevent (FULLPATH_FILENAME_EXT); |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
Implementation: |
|
Syntax: |
testURLConnection(url) |
||||||||||||||||
|
|
||||||||||||||||
Description: |
Tests whether a Http URL connection is available. Returns ‘Y’ if the connection is available or ‘N’ if the connection is unavailable. This function performs a HTTP GET to the calling URL. If a response is not received within 20 seconds then the function will return ‘N’. |
||||||||||||||||
|
|
||||||||||||||||
Examples: |
set AVAILABLE = testurlconnection( ‘http://www.google.co.uk’ ); |
||||||||||||||||
|
|
||||||||||||||||
Implementation: |
|
Syntax: |
write2csv(DIR, FNAME, FIELDS, DELIM, HEAD, NEW, QUOTE) DIR - the directory to which the file should be written FNAME - the name that should be given to the file FIELDS - a comma separated list of form fields whose data should be written to the file DELIM - the character that should be used to separate the data in the file HEAD - should a header row be created using the field names? (Y/N). Note a data row is also written. NEW - should a new file be created? (Y/N) QUOTE - should double quotes be placed around each data element in the file? |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Description: |
Writes data to a delimited text file using parameters passed from a form |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Examples: |
In this example we will create a new CSV file and write a single header row containing the field names, followed by a blank row, and then one row for each row in the MyTable table.
Then we will loop through a table and write out column values to the same file.
Create the Header
Row: char dir, fname, fields, delim, head,
new, quote, status; dir = 'C:/Temp/'; fname = 'MyCsvFile.csv'; // this writes a
header and also a blank data row as there are no such fields in the form fields =
'FIRST_NAME, LAST_NAME, AGE ,TITLE, POSTCODE'; delim = ',' ; head = 'Y'; new = 'Y'; quote = 'Y'; status = write2csv (dir, fname, fields, delim, head, new, quote); Write out the
data elements: head = 'N'; new = 'N'; fields =
'MYTABLE-FIRST_NAME, MYTABLE-LAST_NAME, MYTABLE-AGE , MYTABLE-TITLE,
MYTABLE-POSTCODE'; loop at table MyTable status = write2csv (dir, fname, fields, delim, head,
new, quote); endloop |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
Implementation: |
|
Syntax: |
writetofile(DIR,FILENAME,STRING_VALUE) |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
Description: |
Writes a string value to a text file |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
Examples: |
set DIR =
'c:/temp/'; set FILENAME =
'MyTextFile.txt'; set STRING_VALUE = 'Mary had a little lamb..'; set STATUS = writetofile(DIR,FILENAME,STRING_VALUE); |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
Implementation: |
|