{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Constants Summary{th}{tr}{tbody}{tr}{td}[Number]{td}{td}[#DATETIME]
Constant to be used when the type of a variable needs to be specified.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#INTEGER]
Constant to be used when the type of a variable needs to be specified.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#MEDIA]
Constant to be used when the type of a variable needs to be specified.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#NUMBER]
Constant to be used when the type of a variable needs to be specified.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#TEXT]
Constant to be used when the type of a variable needs to be specified.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#defaultValue]
The default value of the variable.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#name]
The name of the variable.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#variableType]
The type of the variable.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[UUID]{td}{td}[#getUUID]\()
Returns the UUID of the variable{td}{tr}{tbody}{table}\\ 

{table:id=constant|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Constants Details{th}{tr}{tbody:id=DATETIME|class=node}{tr:id=name}{td}h6.DATETIME{td}{tr}{tr:id=des}{td}Constant to be used when the type of a variable needs to be specified.{td}{tr}{tr:id=ret}{td}*Returns*\\ [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var dateVar = solutionModel.newGlobalVariable('gDate', JSVariable.DATETIME);
dateVar.defaultValue = 'now';
application.output(globals.gDate); // Prints the current date and time.
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=INTEGER|class=node}{tr:id=name}{td}h6.INTEGER{td}{tr}{tr:id=des}{td}Constant to be used when the type of a variable needs to be specified.{td}{tr}{tr:id=ret}{td}*Returns*\\ [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var intVar = solutionModel.newGlobalVariable('gInt', JSVariable.INTEGER);
intVar.defaultValue = 997;
application.output(globals.gInt); // Prints 997
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=MEDIA|class=node}{tr:id=name}{td}h6.MEDIA{td}{tr}{tr:id=des}{td}Constant to be used when the type of a variable needs to be specified.{td}{tr}{tr:id=ret}{td}*Returns*\\ [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var mediaVar = solutionModel.newGlobalVariable('gMedia', JSVariable.MEDIA);
mediaVar.defaultValue = 'new Array(1, 2, 3, 4)';
application.output(globals.gMedia); // Prints out the array with four elements.
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=NUMBER|class=node}{tr:id=name}{td}h6.NUMBER{td}{tr}{tr:id=des}{td}Constant to be used when the type of a variable needs to be specified.{td}{tr}{tr:id=ret}{td}*Returns*\\ [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var numberVar = solutionModel.newGlobalVariable('gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(globals.gNumber); // Prints 192.334
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=TEXT|class=node}{tr:id=name}{td}h6.TEXT{td}{tr}{tr:id=des}{td}Constant to be used when the type of a variable needs to be specified.{td}{tr}{tr:id=ret}{td}*Returns*\\ [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var txtVar = solutionModel.newGlobalVariable('gText', JSVariable.TEXT);
txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assing a String as default value.
application.output(globals.gText); // Prints 'some text' (without quotes).
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=property|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=defaultValue|class=node}{tr:id=name}{td}h6.defaultValue{td}{tr}{tr:id=des}{td}The default value of the variable. 

It is interpreted as a JS expression.

For INTEGER variables it can be an integer constant, like 10 for example.
For NUMBER variables it can be a real constant, like 22.41. For DATETIME
variables it can be "now", or a JS expression like "new Date()". For TEXT 
variables it can be any string surrounded with quotes, like 'some text'.{td}{tr}{tr:id=ret}{td}*Returns*\\ [String]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var intVar = solutionModel.newGlobalVariable('gInt', JSVariable.INTEGER);
intVar.defaultValue = 997;
application.output(globals.gInt); // Prints 997
var numberVar = solutionModel.newGlobalVariable('gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(globals.gNumber); // Prints 192.334
var dateVar = solutionModel.newGlobalVariable('gDate', JSVariable.DATETIME);
dateVar.defaultValue = 'now';
application.output(globals.gDate); // Prints the current date and time.
var txtVar = solutionModel.newGlobalVariable('gText', JSVariable.TEXT);
txtVar.defaultValue = '"some text"'; // Use two pairs of quotes if you want to assing a String as default value.
application.output(globals.gText); // Prints 'some text' (without quotes).
var mediaVar = solutionModel.newGlobalVariable('gMedia', JSVariable.MEDIA);
mediaVar.defaultValue = 'new Array(1, 2, 3, 4)';
application.output(globals.gMedia); // Prints out the array with four elements.
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=name|class=node}{tr:id=name}{td}h6.name{td}{tr}{tr:id=des}{td}The name of the variable.{td}{tr}{tr:id=ret}{td}*Returns*\\ [String]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var gVar = solutionModel.newGlobalVariable('gtext', JSVariable.TEXT);
gVar.name = 'anotherName';
gVar.defaultValue = '"default text"';
// The next two lines will print the same output.
application.output(globals[gVar.name]);
application.output(globals.anotherName);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=variableType|class=node}{tr:id=name}{td}h6.variableType{td}{tr}{tr:id=des}{td}The type of the variable. Can be one of: TEXT, INTEGER, NUMBER, DATETIME or MEDIA.{td}{tr}{tr:id=ret}{td}*Returns*\\ [Number]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var g = solutionModel.newGlobalVariable('gtext',JSVariable.TEXT);
globals.gtext = 'some text';
g.variableType = JSVariable.DATETIME;
globals.gtext = 'another text'; // This will raise an error now, because the variable is not longer of type text.
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getUUID|class=node}{tr:id=name}{td}h6.getUUID{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[UUID]{span}{span:id=iets|style=float: left; font-weight: bold;}getUUID{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}Returns the UUID of the variable{td}{tr}{tr:id=ret}{td}*Returns*\\ [UUID]{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var dateVar = solutionModel.newGlobalVariable('gDate', JSVariable.DATETIME);
application.output(dateVar.getUUID().toString());
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}