Method Summary | |
---|---|
String | dateFormat(date, format) Format a date object to a text representation. |
Boolean | hasRecords(foundset) Returns true if the (related)foundset exists and has records. |
Boolean | hasRecords(record, relationString) Returns true if the (related)foundset exists and has records. |
String | numberFormat(number, digits) Format a number to have a defined fraction. |
String | numberFormat(number, format) Format a number to specification. |
Method Details | |
---|---|
dateFormat |
|
String dateFormat (date, format) | |
Format a date object to a text representation.
|
|
Parameters |
|
Returns String - the date as text
|
|
Sample var formattedDateString = utils.dateFormat(dateobject,'EEE, d MMM yyyy HH:mm:ss'); |
|
hasRecords |
|
Boolean hasRecords (foundset) | |
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 |
|
Parameters {JSFoundSet} foundset - the foundset to be tested
|
|
Returns Boolean - true if exists
|
|
Sample //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 //} |
|
hasRecords |
|
Boolean hasRecords (record, relationString) | |
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 |
|
Parameters |
|
Returns Boolean - true if the foundset/relation has records.
|
|
Sample //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 //} |
|
numberFormat |
|
String numberFormat (number, digits) | |
Format a number to have a defined fraction.
|
|
Parameters |
|
Returns String - the resulting number in text
|
|
Sample var textalNumber = utils.numberFormat(16.749, 2); //returns 16.75 |
|
numberFormat |
|
String numberFormat (number, format) | |
Format a number to specification.
|
|
Parameters |
|
Returns String - the resulting number in text
|
|
Sample var textalNumber2 = utils.numberFormat(100006.749, '#,###.00'); //returns 100,006.75 |
|