Child pages
  • Utils

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Rev: 1381949650879

...

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
tbody
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#dateFormatdateFormat(date, format)
Format a date object to a text representation.
tbody
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasRecordshasRecords(foundset)
Returns true if the (related)foundset exists and has records.
tbody
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#hasRecordshasRecords(record, relationString)
Returns true if the (related)foundset exists and has records.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#numberFormatnumberFormat(number, digits)
Format a number to have a defined fraction.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#numberFormatnumberFormat(number, format)
Format a number to specification.

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
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)