@param
The @
character is used when declaring and using a variable.
The following example sets a variable to "Example".
Example
set @textvar = 'Example'
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code sets the caption of the label to "Example".
Example
let @textvar = 'Example'
set :caption = @textvar
avg()
The avg()
function is used to return the average value of a numeric field.
Syntax
avg(number)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets a variable to the average value of the field "Salary".
Example
set @avgSalary = avg("Salary")
abs()
The abs()
function is used to return the absolute value of a number.
Syntax
abs(number)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets a variable to the absolute value of -23.
Example
set @numVariable = abs(-23)
Call
The call
statement is used to execute a routine.
The statement can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code saves the datasource of the detail when the button is clicked.
Example
call save()
captureSignature()
The captureSignature()
function is used to save an image of a signature to a File type field or variable. It’s mainly used together with a button.
The file formats that is supported are png, jpg and svg.
Syntax
capture('Label', 'File format')
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code makes a window pop up where the signature will be written. The signature is then saved to the record as a png file.
For the image to be saved to the record, there must be a Media component in the form that has the right field connected to it. |
Example
set Signature = captureSignature('Sign here please', 'png')
call save()
ceil()
The ceil()
function returns the smallest integer value bigger than or equal to a numeric parameter.
Syntax
ceil(number)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets a variable to the smallest integer bigger than 22.7
Example
set @numVariable = ceil(22.7)
chr()
The chr()
function returns the character for the specified ASCII number code.
Syntax
chr(number)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets a variable to the character "Line Feed".
Example
set @char = chr(10)
Contains
The contains
operator is used in conditions to search for patterns in text. The contains
operator is often used combined with the where clause.
Syntax
Text or Note Field name contains 'text'
Note that it cannot be used with a variable, like:
@variable contains 'text'
The operator can be used in :
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the values of the fields Full name and Salary from all records in the Employee table, where the Full name value contains the pattern "na".
Example
"Full name", Salary from Employee
where "Full name" contains 'na'
count()
The count()
function return the number of records that matches a criterion.
Syntax
count(Field name) from Table name
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display how many employees every department has from a table named Employee. The chart is both grouped and sorted by Department.
Example
Department, count(Recordname) from Employee
group by Department
order by Department
create()
The create()
function creates a new record when called.
Syntax
call create()
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code creates a new record in the datasource of the detail when the button is clicked.
Example
call create()
currentuser()
The currentuser()
function returns the user ID of the current user.
Syntax
currentuser()
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code sets the caption of the label to the user ID of the current user.
Example
set :caption = currentuser()
currentusername()
The currentusername()
function returns the username of the current user.
Syntax
currentusername()
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code sets the caption of the label to the username of the current user.
Example
set :caption = currentusername()
days()
The days()
function returns the difference between two Date fields, as a number.
Syntax
days(Start date, End date)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code sets the caption of the label to the amount of days between the field value Start date and today.
Example
set :caption = days("Start date", today())
where the result is "6" (days), if we consider today’s date to be December the 7th, and Start date as December the 1st.
delete()
The delete()
function is used to delete records.
Syntax
call delete()
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code deletes the selected record when the button is clicked.
Example
call delete()
endswith
The endswith
operator is used to check if a text type value ends with a specified text pattern. The operator is often used combined with the where clause.
Syntax
Field name endswith 'text'
The operator can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the values of the fields Full name and Salary from all records in the Employee table, where the Full name value ends with "son".
Example
"Full name", Salary from Employee
where "Full name" endswith 'son'
floor()
The floor()
function returns the largest integer value smaller than or equal to a numeric parameter.
Syntax
floor(number)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets a variable to the largest integer smaller than 22.7.
Example
set @numVariable = floor(22.7)
form()
The form()
function is used to return a form from the form name. It is often used together with the open()
function.
Syntax
form('Form name')
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code opens the form, Employee Overview.
Example
call open(form("Employee Overview"))
formatdate()
The formatdate()
function returns a text string representing a date formatted according to the specified pattern.
Syntax
formatdate(Date,'format')
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code sets the caption of the label to the value of the field Start date formated as "Day DD, Month, YYYY".
Example
set :caption = formatdate("Start date",'Day DD, Month, YYYY')
Read more about this function here.
formatNumber()
The formatNumber()
function returns a string representing a number formatted according to a specified format.
Syntax
formatnumber(Number, 'format')
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code sets the caption of the label to the value of the field Distance formated as ".#", i.e 2 decimals.
Example
set :caption = formatnumber(Distance,'#.##')
geodist()
The geodist()
function returns the distance between two latitude and longitude coordinates.
Syntax
geodist(latitude-1, longitude-1, latitude-2, longitude-2)
The type of the parameters is number. |
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code sets the caption of the label to the distance beetween the two coordinates represented by the number fields latitude1, longitude1, latitude2, longitude2. The distance is displayed in meters.
Example
set :caption = 1e3 * geodist(latitude1, longitude1, latitude2, longitude2)
If, Then, Else and End - Statements
The if
, then
, else
and end
statements is used for executing actions when certain criterion is met.
Syntax
if Condition then
Action
else
Action
end
The statements can be used as following:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code makes the caption of the label change dependent of what role the user has.
Example
if userhasrole('ADMIN') then
set :caption = 'Welcome Admin'
else
set :caption = 'Welcome ' || currentusername()
end
In ()
The in ()
operator is used to specify multiple values. The operator is a shorthand for multiple or
conditions.
Syntax
Field name in (value1, value2, ...)
The operator can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the values of the fields Full name and Salary from all records in the Employee table, where the dropdown type value of Department is Sales or Finance.
Example
"Full name", Salary from Employee
where Department in (Finance,Sales)
Is
The is
operator is used for detecting if a value is null or not. Null is unknown, not applicable or missing information, accordingly, it’s not possible to use comparison operators (=,<,>,etc..). Therefore the is
operator is used.
Syntax
Field name is (not) null
The operator can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the values of the fields Full name and Department from all records in the Employee table where the field Phone number is not null.
Example
"Full name", Department from Employee
where "Phone number" is not null
length()
The length()
function returns the length of a specified string.
Syntax
length(text)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code sets the caption of the label to the length of the Full name value in a record.
Example
set :caption = length("Full name")
Let
The let
command defines a value for use in another expression.
The command can be used as following:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
The following example sets a variable to "b".
Example
let @textvar = 'abc'
set :caption = substring(@textvar,2,1)
Like
The like
operator is used for searching fo a specified pattern in text values.
There are two wildcards that can be used with the like
operator:
-
The
%
or*
signs represent multiple characters. -
The
_
or?
signs represent one, single character.
Syntax
Field name like 'text'
The operator can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the values of the fields Full name and Salary from all records in the Employee table, where the Full name value has an "a" as second character.
Example
"Full name", Salary from Employee
where "Full name" like '?a*'
lower()
The lower()
function returns a specified string with only lower-case letters.
Syntax
lower(text)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code sets the caption of the label to "lower-case".
Example
set :caption = lower('Lower-Case')
max()
The max()
function returns the maximum value from a field where certain criterion are met.
Syntax
max(Field name) from Table name
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the highest salary from each department from a table named Employee. The chart is grouped by Department.
Example
Department, max(Salary) from Employee
group by Department
median()
The median()
function returns the median value from a field where certain criterion are met.
Syntax
median(Field name) from Table name
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the median salary from each department from a table named Employee. The chart is grouped by Department.
Example
Department, median(Salary) from Employee
group by Department
min()
The min()
function returns the smallest value from a field where certain criterion are met.
Syntax
min(Field name) from Table name
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the lowest salary from each department from a table named Employee. The chart is grouped by Department.
Example
Department, min(Salary) from Employee
group by Department
Not
The not
operator is used with a condition to give the opposite result.
Syntax
not Condition
The operator can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the values of the fields Full name and Salary from all records in the Employee table, where the dropdown type value of Department isn’t Sales.
Example
"Full name", Salary from Employee
where Department not in (Sales)
now()
The now()
function is used to return the Date time type value of the moment when the function is called.
Syntax
now()
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code sets the Latest clock-in value in the selected record to the Date time type value of when the button is clicked.
Example
set "Latest clock-in" = now()
nvl()
The nvl()
function is used to replace a null value to a specified value.
Syntax
nvl(Field name, value)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from Run IQL the Rules manager. The code is written to set the Salary field value to 20 000 if the Salary field is empty when a record is created.
Example
set Salary = nvl(Salary, 20000)
open()
The open()
function is used to open a form.
Syntax
call open(form('form name'))
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code opens the form, Employee Overview.
Example
call open(form("Employee Overview"))
openRelated()
The open()
function is used to open a form and use the value of a Relation type field to send to the form.
Syntax
call openRelated(form('form name'), Relation field)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The detail section displays records from the table, Employees. The Employees table has a Relation type field that is named Latest project and has Project as parent table. The code opens the form, Project Overview with the selected record’s Latest project value as chosen record.
Example
call openRelated(form("Project Overview"), "Latest project")
openUrl()
The openUrl()
function is used to open a specified url.
Syntax
call openUrl('Url')
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button. The code opens the Google image page for "Giraffes".
Example
call openUrl('https://www.google.com/search?sca_esv=7035ff6bfa45f4a8&sca_upv=1&sxsrf=ADLYWIK1GNR7E7FifIAx2eLeUNpkqYdZyg:1722522357572&q=Giraffes&udm=2')
parsedate()
The parsedate()
function is used to return a date type value parsed from a specified string.
Syntax
parsedate(text, date format)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets the variable, @date1
to the same value as the Date time type field, Latest clock-in, except that the time is set to midnight.
Example
set @date1 = parsedate(formatdate("Latest clock-in", 'YYMMDDHH')|| '000000', 'YYMMDDHHMISS')
Read more about this function here.
parsenumber()
The parsenumber()
function returns a number parsed from a specified string.
Syntax
parsenumber(text)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets the value of a variable to 20.
Example
set @number = parsenumber('20')
random()
The random()
function return a a randomized number between two specified numbers.
Syntax
random(number, number)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Rules manager. The code is written to set the value of Salary, to a random value between 10 000 and 100 000.
Example
set Salary = random(1e4, 1e5)
randomstring()
The randomstring()
function returns a string with a specified number of characters.
Syntax
randomstring(number)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Rules manager. The code is written to set the value of Baby name to a string with 5 randomized characters.
Example
set "Baby name" = randomstring(5)
replace()
The replace()
function is a function that returns a string there some specified parts have been replaced by a specified string in an original text.
Syntax
replace('Original text', 'text to replace', 'text to be added')
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets a variable to "What’s your postal code?"
Example
set @textVariable = replace('What's your PC?', 'PC', 'postal code')
round()
The floor()
function returns the closest integer value to a numeric parameter. If the parameter is right between 2 integers, the higher one is returned.
Syntax
round(number)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets a variable to 23
Example
set @numVariable = round(22.7)
The following example sets a variable to 32
Example
set @numVariable = round(32.2)
runReport()
The runReport()
function is used to run a report.
Syntax
call runReport(Report ID)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button. The code runs the report with 100224 as report id when the button is clicked.
Example
call runReport(100224)
runReportImmediate()
The runReportImmediate()
function is used to run a specified report and saves it in a specified format. The format may be 'PDF', 'EXCEL' or 'HTML'.
Syntax
call runReportImmediate(Report ID, 'Format')
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button. The code runs the report with 100224 as report id and saves the report as an Excel file when the button is clicked.
Example
call runReportImmediate(100224, 'EXCEL')
runReportImmediateAndStore()
The runReportImmediateAndStore()
function is used to run a report and save it in a specified file field in a specified format.
Syntax
call runReportImmediateAndStore(Report ID, 'Format', File field)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button. When the button is clicked, the code runs the report with 100224 as report id and saves the report as an Excel file in the File field named Latest report.
Example
call runReportImmediate(100224, 'EXCEL', "Latest report"
)
runReportImmediateAndStoreWithName()
The runReportImmediateAndStoreWithName()
function is used to run a report and save it in a specified file field in a specified format.
Syntax
call runReportImmediateAndStoreWithName(Report ID, 'Format', File field, 'File name')
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button. When the button is clicked, the code runs the report with 100224 as report id and saves the report as an Excel file with LatestFile as name in the File field named Latest report.
Example
call runReportImmediate(100224, 'EXCEL', "Latest report", 'LatestFile')
save()
The save()
function saves the changes in the selected record when called.
Syntax
call save()
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code makes the changes in the detail section get saved when the button is clicked.
Example
call save()
saveAsNew()
The saveAsNew()
function saves the selected record with changes as a new record.
Syntax
call saveAsNew()
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code makes the selected record in the detail section get saved as a new record.
Example
call saveAsNew()
scanQrCode()
The scanQrCode()
function is used to open up the camera on the user’s device and scan a Qr code.
The information in the Qr code can then be stored in a variable or a field.
Syntax
scanQrCode()
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button. The code sets the variable, @qrInformation to the data that is stored in the qr code which will be scanned after the button is clicked.
Example
set @qrInformation = scanQrCode()
Set
The set
command is used to update a value. It can be used to update Field values or variables.
The command can be used as following:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a Text component. The code makes the text color red in the component if the user has the role ADMIN.
Example
if userhasrole('ADMIN') then
set :textColor = 'red'
end
The following IQL is an example from the Rules manager. The code is written to set the value of the field, "Full name" to a concatenation of the fields, "First name" and "Last name".
Example
set "Full name" = "First name" || ' ' || "Last name"
startswith
The startswith
operator is used to check if a text type value starts with a specified text pattern. The operator is often used combined with the where clause.
Syntax
Field name startswith 'text'
The operator can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the values of the fields Full name and Salary from all records in the Employee table, where the Full name value starts with "Si".
Example
"Full name", Salary from Employee
where "Full name" startswith 'Si'
string()
The string()
function returns a text representation of the parameter.
Syntax
string(Field name)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a Label component. The code makes the label’s caption a representation for an image.
Example
set :caption = string(Image)
substring()
The substring()
function is used to extract a string from another string.
Syntax
substring('text', Start index, length)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets a variable to "abc efg".
Example
let @textvar = 'abcdefg'
set :caption = substring(@textvar,1,3)||' '||substring(@textvar,5,3)
sum()
The sum()
function returns the sum of the values from a field where certain criterion are met.
Syntax
sum(Field name) from Table name
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the sum of all salaries from each department from a table named Employee. The chart is grouped by Department.
Example
Department, sum(Salary) from Employee
group by Department
takePhoto()
The takePhoto()
function is used to save a photo to a field or variable.
Syntax
takePhoto()
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code makes the computer’s file manager pop up. When a picture is chosen from the file manager, the field Avatar is set to the chosen picture.
Example
set Avatar = takePhoto()
today()
The today()
function returns the Date type value of when it’s called.
Syntax
today()
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as a Run on click routine for a button that has a detail as parent. The code sets the Start date value in the selected record to the Date type value of when the button is clicked.
Example
set "Start date" = today()
trunc()
The trunc()
function returns the largest integer smaller than the parameter if the parameter is a number. If the parameter is of the type Date or Date time, then the same date value is returned but the time is set to midnight.
Syntax
trunc(Number)
or
trunc(Date)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following example sets a variable to the largest integer smaller than 22.7
Example
set @numVariable = trunc(22.7)
The following example sets a variable to today’s date without using the floor() function.
Example
set @dateVariable = trunc(now())
upper()
The upper()
function returns a specified string with only capital letters.
Syntax
upper(text)
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
The following IQL is an example from the Form designer. The code is written as behavior for a label. The code sets the caption of the label to "UPPER-CASE".
Example
set :caption = lower('Upper-Case')
userhasrole()
The userhasrole()
function takes a string as parameter and returns a boolean. If the current user has a role that matches the parameter, true is returned. In the other case false is returned.
Syntax
userhasrole(text)
The following IQL is an example from the Form designer. The code is written as behavior for a Text component. The code makes it impossible to write in the component if the user doesn’t have the role ADMIN.
Example
set :readOnly = not userhasrole('ADMIN')
Where
The where
clause is used to filter records.
This clause is only used in configuration of Charts and Rules. |
Syntax
Field name from Table name
where Condition
The function can be used in:
Forms |
Rules |
|
---|---|---|
Behavior |
Run on: click, change, init and select |
|
x |
x |
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display the values of the fields Full name and Salary from all records in the Employee table, where the Full name value contains an "a".
Example
"Full name", Salary from Employee
where "Full name" contains 'a'
Group by
The group by
clause is exclusive for configuration of Charts and is used to arrange identical data into groups. It must be used in combination with aggregation functions (count, sum, etc.).
Syntax
Field name 1 ,Aggregation function(Field name 2) from Table name
group by Field name 1
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display how many employees every department has from a table named Employee. The chart is grouped by Department.
Example
Department, count(Recordname) from Employee
group by Department
Order by
The order by
clause is exclusive for configuration of Charts and is used to ort data by one column in ascending order by default. Add the keyword desc
after to sort in descending order.
Syntax
Field name 1, Field name 2 from Table name
order by Field name
The following IQL is an example from the Form designer. The code is written in a IQL chart, and it makes the IQL chart display how many employees every department has from a table named Employee. The chart is both grouped and sorted by Department.
Example
Department, count(Recordname) from Employee
group by Department
order by Department