Child pages
  • Utils

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Div
styledisplay: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.

Enter additional information related to this 'class' inside the {div} macro with 'id=description'

Div
iddescription



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
dateFormat(date, format)
Format a date object to a text representation.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
hasRecords(foundset)
Returns true if the (related)foundset exists and has records.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
hasRecords(record, relationString)
Returns true if the (related)foundset exists and has records.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
numberFormat(number, digits)
Format a number to have a defined fraction.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
numberFormat(number, format)
Format a number to specification.



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
iddateFormat-Date_String
Table Row (tr)
idname
Table Cell (td)

dateFormat

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
dateFormat
Span
(date, format)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Format a date object to a text representation.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Date} date - the date
{String} format - the format to output
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String - the date as text
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var formattedDateString = utils.dateFormat(dateobject,'EEE, d MMM yyyy HH:mm:ss');
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idhasRecords-JSFoundSet
Table Row (tr)
idname
Table Cell (td)

hasRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
hasRecords
Span
(foundset)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true if the (related)foundset exists and has records.
Another use is, to pass a record and qualified relations string to test multiple relations/foundset at once
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{JSFoundSet} foundset - the foundset to be tested
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if exists
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//test the orders_to_orderitems foundset
if (elements.customer_id.hasRecords(orders_to_orderitems))
{
	//do work on relatedFoundSet
}
//test the orders_to_orderitems.orderitems_to_products foundset to be reached from the current record
//if (elements.customer_id.hasRecords(foundset.getSelectedRecord(),'orders_to_orderitems.orderitems_to_products'))
//{
//	//do work on deeper relatedFoundSet
//}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idhasRecords-JSRecord_String
Table Row (tr)
idname
Table Cell (td)

hasRecords

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
hasRecords
Span
(record, relationString)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true if the (related)foundset exists and has records.
Another use is, to pass a record and qualified relations string to test multiple relations/foundset at once
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{JSRecord} record - A JSRecord to test.
{String} relationString - The relation name.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if the foundset/relation has records.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
//test the orders_to_orderitems foundset
if (elements.customer_id.hasRecords(orders_to_orderitems))
{
	//do work on relatedFoundSet
}
//test the orders_to_orderitems.orderitems_to_products foundset to be reached from the current record
//if (elements.customer_id.hasRecords(foundset.getSelectedRecord(),'orders_to_orderitems.orderitems_to_products'))
//{
//	//do work on deeper relatedFoundSet
//}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnumberFormat-Number_Number
Table Row (tr)
idname
Table Cell (td)

numberFormat

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
numberFormat
Span
(number, digits)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Format a number to have a defined fraction.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} number - the number to format
{Number} digits - nr of digits
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String - the resulting number in text
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var textalNumber = utils.numberFormat(16.749, 2); //returns 16.75
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idnumberFormat-Number_String
Table Row (tr)
idname
Table Cell (td)

numberFormat

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
numberFormat
Span
(number, format)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Format a number to specification.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} number - the number to format
{String} format - the format
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String - the resulting number in text
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var textalNumber2 = utils.numberFormat(100006.749, '#,###.00'); //returns 100,006.75
Table Row (tr)
classlastDetailRow
Table Cell (td)