May 13, 2024 08:28 Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients SampleSupported Clients
SmartClient
WebClient
NGClient
MobileClient
Constants Summary
Number
DATETIME
Constant to be used when the type of a variable needs to be specified.
Number
INTEGER
Constant to be used when the type of a variable needs to be specified.
Number
MEDIA
Constant to be used when the type of a variable needs to be specified.
Number
NUMBER
Constant to be used when the type of a variable needs to be specified.
Number
TEXT
Constant to be used when the type of a variable needs to be specified.
Property Summary
String
defaultValue
The default value of the variable.
String
name
The name of the variable.
Number
variableType
The type of the variable.
Methods Summary
String
getScopeName()
Get scope name
UUID
getUUID()
Returns the UUID of the variable
Constants Details
DATETIME
var dateVar = solutionModel.newGlobalVariable('globals', 'gDate', JSVariable.DATETIME);
dateVar.defaultValue = 'now';
application.output(scopes.globals.gDate); // Prints the current date and time.
INTEGER
var intVar = solutionModel.newGlobalVariable('globals', 'gInt', JSVariable.INTEGER);
intVar.defaultValue = 997;
application.output(scopes.globals.gInt); // Prints 997
MEDIA
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.
NUMBER
var numberVar = solutionModel.newGlobalVariable('globals', 'gNumber', JSVariable.NUMBER);
numberVar.defaultValue = 192.334;
application.output(scopes.globals.gNumber); // Prints 192.334
TEXT
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).
Property Details
defaultValue
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.
name
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);
variableType
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.
Methods Details
getScopeName()
var globalVariables = solutionModel.getGlobalVariables();
for (var i in globalVariables)
application.output(globalVariables[i].name + ' is defined in scope ' + globalVariables[i].getScopeName());
getUUID()
var dateVar = solutionModel.newGlobalVariable('globals', 'gDate', JSVariable.DATETIME);
application.output(dateVar.getUUID().toString());