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


Property Summary
String
#code
The full source code of this method (including doc and function declaration).
Number
#variableType
Get or set the sql type of this variable.

Method Summary
String
#getName()
This method returns the name of the stored calculation.
UUID
#getUUID()
Returns the UUID of the calculation.
Boolean
#isStored()
Returns whether this calculation is a stored one or not.

Property Details
code
The full source code of this method (including doc and function declaration).
Returns
String
Sample
var calc = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculation("myCalculation");
calc.code = "function myCalculation() { return 123; }";

variableType

Get or set the sql type of this variable.

Type should be one of JSVariable.DATETIME, JSVariable.TEXT, JSVariable.NUMBER , JSVariable.INTEGER or JSVariable.MEDIA.

Returns
Number
Sample


Method Details
getName
String
getName
()
This method returns the name of the stored calculation.
Returns
String – the name of the stored calculation
Sample
var calc = solutionModel.newCalculation("function myCalculation() { return 123; }", JSVariable.INTEGER, "db:/example_data/customers");
application.output(calc.getName());

getUUID
UUID
getUUID
()
Returns the UUID of the calculation.
Returns
UUID
Sample
var calc = solutionModel.getDataSourceNode("db:/example_data/customers").newCalculation("function myCalculation() { return 123; }", JSVariable.INTEGER);
application.output(calc.getUUID().toString());

isStored
Boolean
isStored
()
Returns whether this calculation is a stored one or not.
Returns
Boolean – true if the calculation is stored, false otherwise
Sample
var calc = solutionModel.getDataSourceNode("db:/example_data/customers").newCalculation("function myCalculation() { return 123; }", JSVariable.INTEGER);
if (calc.isStored()) application.output("The calculation is stored");
else application.output("The calculation is not stored");