Child pages
  • JSCalculation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Divcache
Div
iddescription
HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Row (tr)
Table Cell (td)
String
Table Cell (td)code
styleindexdisplay:none

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.

true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable
id

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Property SummaryThe full source code of this method (including doc and function declaration). Table Row (tr)

Table Cell (td)
Number
Table Cell (td)variableType
Get or set the sql type of this variable. HTML Table

classservoy sSummaryid

Colgroup Tag
Col
width80px
Col
Table Head (thead) Table Row (tr)style Table Row (tr)
Table Cell (td)
String
Table Cell (td)getName()
servoy sSummary12%30%58%height: 30px;
Table Head (th)
colspan2
Method Summary
3Methods SummaryThis method returns the name of the stored calculation. Table Row (tr)
Table Cell (td)
UUID
Table Cell (td)getUUID()
Table Cell (td)hasFlag(flag)
Returns the UUID of the calculation. Table Row (tr)
Table Cell (td)
Boolean
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)isStored()
Check a flag of the calculation.Returns whether this calculation is a stored one or not. HTML Table

propertyclass Colgroup Tag Colcolspanservoy sDetail2width100%

Col
Table Head (thead) Table Row (tr)styleheight:30px; Table Head (th)colspan2Property Details Table Body (tbody)ididcode Table Row (tr)nametd

code

Table Row (tr)id

des Table Cell (td) DivclasssIndent
The full source code of this method (including doc and function declaration).
Table Row (tr)id
ret

Table Cell (td)

Returns

divsIndentclients

classtd

Supported Clients

sIndent
String Table Row (tr)
idsam
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idgetName
Table Row (tr)
idname
Table Cell (td)

getName

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
This method returns the name of the stored calculation.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String - the name of the stored calculation
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var calc = solutionModel.newCalculation("function myCalculation() { return 123; }", JSVariable.INTEGER, "db:/example_data/customers");
application.output(calc.getName());
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetUUID
Table Row (tr)
idname
Table Cell (td)

getUUID

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
UUID
Span
stylefont-weight: bold;
getUUID
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the UUID of the calculation.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
UUID
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var calc = solutionModel.getDataSourceNode("db:/example_data/customers").newCalculation("function myCalculation() { return 123; }", JSVariable.INTEGER);
application.output(calc.getUUID().toString());
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idhasFlag-Number
Table Row (tr)
idname
Table Cell (td)

hasFlag

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
hasFlag
Span
(flag)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Check a flag of the calculation.
The flags are a bit pattern consisting of 1 or more of the following bits:
- JSColumn.UUID_COLUMN
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} flag
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - boolean whether flag is set.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var datasourceNode = solutionModel.getDataSourceNode('db:/example_data/orders')
var calculation = datasourceNode.getCalculation('mycalculation')
if (calculation.hasFlag(JSColumn.UUID_COLUMN))
{
	 // calculation was typed as UUID
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idisStored
Table Row (tr)
idname
Table Cell (td)

isStored

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
isStored
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns whether this calculation is a stored one or not.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - SmartClient,WebClient,NGClientsam

Sample

Div
classsIndent
Code Block
languagejavascript
var calc = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculation("myCalculation");
calc.code = "function myCalculation() { return 123; }";
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idvariableType
Table Row (tr)
idname
Table Cell (td)

variableType

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
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.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var calc = solutionModel.getDataSourceNode("db:/example_data/customers").getCalculation("myCalculation");
calc.variableType = JSVariable.DATETIME;
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
HTML Table
idfunction
classservoy sDetail
sIdentjavascriptlastDetailRowvariableTypename

variableType

dessIndent
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.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

idfunctionservoy sDetail2100%height:30px2Methods DetailsgetNamename

getName()

dessIndent
This method returns the name of the stored calculation.
ret

Returns

sIndent the name of the stored calculation
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowgetUUIDname

getUUID()

dessIndent
Returns the UUID of the calculation.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
hasFlagname

hasFlag(flag)

dessIndent
Check a flag of the calculation.
The flags are a bit pattern consisting of 1 or more of the following bits:
 - JSColumn.UUID_COLUMN
prs

Parameters

sIndentflag ;
ret

Returns

sIndent boolean whether flag is set.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isStoredname

isStored()

dessIndent
Returns whether this calculation is a stored one or not.
ret

Returns

sIndent true if the calculation is stored, false otherwise
clients

Table Row (tr)

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Table Cell (td) Table Row (tr)

classlastDetailRow
Table Cell (td) 

Sample

Div
classsIndent
Code Block
languagejavascript
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");
sIdentjavascriptlastDetailRow