DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR. Enter additional information related to this 'class' inside the {div} macro with 'id=description'
...
id
description
...
true
refresh
100d
showRefresh
true
id
doc
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClientservoy sSummary12%30%58%height: 30px;3Constants SummaryConstant to be used when the type of a variable needs to be specified.
For form variables ,setting this property requires the form instances to be destroyed sIndentclients
...
class
sIndent
...
Table Row (tr)
id
sam
Table Cell (td)
Sample
Div
class
sIndent
Code Block
language
javascript
var dateVar = solutionModel.newGlobalVariable('globals', 'gDate', JSVariable.DATETIME);
dateVar.defaultValue = 'now';
application.output(scopes.globals.gDate); // Prints the current date and time.
...
class
lastDetailRow
...
id
INTEGER
Table Row (tr)
id
name
Table Cell (td)
INTEGER
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Constant to be used when the type of a variable needs to be specified.
var mediaVar = solutionModel.newGlobalVariable('globals', 'gMedia', JSVariable.MEDIA);
mediaVar.defaultValue = 'new Array(1, 2, 3, 4)';
application.output(scopes.globals.gMedia); // Prints out the array with four elements.
...
class
lastDetailRow
...
id
NUMBER
Table Row (tr)
id
name
Table Cell (td)
NUMBER
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
Constant to be used when the type of a variable needs to be specified.
var txtVar = solutionModel.newGlobalVariable('globals', 'gText', JSVariable.TEXT);
txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assign a String as default value.
application.output(scopes.globals.gText); // Prints 'some text' (without quotes).
The default value of the variable.
It is interpreted as a JS expression.
For form variables ,setting this property requires the form instances to be destroyed (history.remove("formName")).
var intVar = solutionModel.newGlobalVariable('globals', 'gInt', JSVariable.INTEGER);
intVar.defaultValue = 997;
application.output(scopes.globals.gInt); // Prints 997
var numberVar = solutionModel.newGlobalVariable('globals', 'gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(scopes.globals.gNumber); // Prints 192.334
var dateVar = solutionModel.newGlobalVariable('globals', 'gDate', JSVariable.DATETIME);
dateVar.defaultValue = 'now';
application.output(scopes.globals.gDate); // Prints the current date and time.
var txtVar = solutionModel.newGlobalVariable('globals', 'gText', JSVariable.TEXT);
txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assign a String as default value.
application.output(scopes.globals.gText); // Prints 'some text' (without quotes).
var mediaVar = solutionModel.newGlobalVariable('globals', 'gMedia', JSVariable.MEDIA);
mediaVar.defaultValue = 'new Array(1, 2, 3, 4)';
application.output(scopes.globals.gMedia); // Prints out the array with four elements.
var gVar = solutionModel.newGlobalVariable('globals', 'gtext', JSVariable.TEXT);
gVar.name = 'anotherName';
gVar.defaultValue = '"default text"';
// The next two lines will print the same output.
application.output(scopes.globals[gVar.name]);
application.output(scopes.globals.anotherName);
Table Row (tr)
class
lastDetailRow
Table Cell (td)
Table Body (tbody)
id
variableType
Table Row (tr)
id
name
Table Cell (td)
variableType
Table Row (tr)
id
des
Table Cell (td)
Div
class
sIndent
The type of the variable. Can be one of: TEXT, INTEGER, NUMBER, DATETIME or MEDIA.
var g = solutionModel.newGlobalVariable('globals', 'gtext',JSVariable.TEXT);
scopes.globals.gtext = 'some text';
g.variableType = JSVariable.DATETIME;
scopes.globals.gtext = 'another text'; // This will raise an error now, because the variable is not longer of type text.
var globalVariables = solutionModel.getGlobalVariables();
for (var i in globalVariables)
application.output(globalVariables[i].name + ' is defined in scope ' + globalVariables[i].getScopeName());