Table Head (thead) |
---|
Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Format a date object to a text representation. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Date} date - the date {String} format - the format to output |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var formattedDateString = utils.dateFormat(dateobject,'EEE, d MMM yyyy HH:mm:ss'); |
|
|
|
|
Table Body (tbody) |
---|
id | getUnicodeCharacter-Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getUnicodeCharacter |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(unicodeCharacterNumber) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns a string containing the character for the unicode number. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} unicodeCharacterNumber - the number indicating the unicode character |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - a string containing the unicode character |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns a big dot
var dot = utils.getUnicodeCharacter(9679); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
hasRecords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| 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) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {JSFoundSet} foundset - the foundset to be tested |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //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 Body (tbody) |
---|
id | hasRecords-JSRecord_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
hasRecords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(record, relationString) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| 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) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {JSRecord} record - A JSRecord to test. {String} relationString - The relation name. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - true if the foundset/relation has records. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //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 Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
isMondayFirstDayOfWeek |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
| isMondayFirstDayOfWeek |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns true when Monday is the first day of the week for your current locale setting. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - true if Monday is first day of the week in current locale |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| if(utils.isMondayFirstDayOfWeek())
{
//a date calculation
} |
|
|
|
|
Table Body (tbody) |
---|
id | numberFormat-Number_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Format a number to have a defined fraction. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} number - the number to format {Number} digits - nr of digits |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the resulting number in text |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var textalNumber = utils.numberFormat(16.749, 2); //returns 16.75 |
|
|
|
|
Table Body (tbody) |
---|
id | numberFormat-Number_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Format a number to specification. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Number} number - the number to format {String} format - the format |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the resulting number in text |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var textalNumber2 = utils.numberFormat(100006.749, '#,###.00'); //returns 100,006.75 |
|
|
|
|
Table Body (tbody) |
---|
id | parseDate-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Parse a string to a date object. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} date - the date as text {String} format - the format to parse the to date |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Date - the date as date object |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var parsedDate = utils.parseDate(datestring,'EEE, d MMM yyyy HH:mm:ss'); |
|
|
|
|
Table Body (tbody) |
---|
id | stringEscapeMarkup-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringEscapeMarkup |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the escaped markup text (HTML/XML). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var escapedText = utils.stringEscapeMarkup('<html><body>escape me</body></html>') |
|
|
|
|
Table Body (tbody) |
---|
id | stringEscapeMarkup-String_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringEscapeMarkup |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(textString, escapeSpaces) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the escaped markup text (HTML/XML). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process {Boolean} escapeSpaces - indicating to escape spaces |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var escapedText = utils.stringEscapeMarkup('<html><body>escape me</body></html>') |
|
|
|
|
Table Body (tbody) |
---|
id | stringEscapeMarkup-String_Boolean_Boolean |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringEscapeMarkup |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(textString, escapeSpaces, convertToHtmlUnicodeEscapes) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the escaped markup text (HTML/XML). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process {Boolean} escapeSpaces - indicating to escape spaces {Boolean} convertToHtmlUnicodeEscapes - indicating to use unicode escapes |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var escapedText = utils.stringEscapeMarkup('<html><body>escape me</body></html>') |
|
|
|
|
Table Body (tbody) |
---|
id | stringFormat-String_ObjectArray |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(text_to_format, parameters) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Formats a string according to format specifiers and arguments. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text_to_format - the text to format {Object[]} parameters - the array with parameters |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the formatted text |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| // the format specifier has the syntax: %[argument_index$][flags][width][.precision]conversion
// argument index is 1$, 2$ ...
// flags is a set of characters that modify the output format
// typical values: '+'(The result will always include a sign), ','(The result will include locale-specific grouping separators)
// width is a non-negative decimal integer indicating the minimum number of characters to be written to the output
// precision is a non-negative decimal integer usually used to restrict the number of characters
// conversion is a character indicating how the argument should be formatted
// typical conversion values: b(boolean), s(string), c(character), d(decimal integer), f(floating number), t(prefix for date and time)
// Date/Time Conversions (used after 't' prefix):
// 'H' Hour of the day for the 24-hour clock, formatted as two digits with a leading zero as necessary i.e. 00 - 23.
// 'I' Hour for the 12-hour clock, formatted as two digits with a leading zero as necessary, i.e. 01 - 12.
// 'k' Hour of the day for the 24-hour clock, i.e. 0 - 23.
// 'l' Hour for the 12-hour clock, i.e. 1 - 12.
// 'M' Minute within the hour formatted as two digits with a leading zero as necessary, i.e. 00 - 59.
// 'S' Seconds within the minute, formatted as two digits with a leading zero as necessary, i.e. 00 - 60 ("60" is a special value required to support leap seconds).
// 'L' Millisecond within the second formatted as three digits with leading zeros as necessary, i.e. 000 - 999.
// 'p' Locale-specific morning or afternoon marker in lower case, e.g."am" or "pm". Use of the conversion prefix 'T' forces this output to upper case.
// 'z' RFC 822 style numeric time zone offset from GMT, e.g. -0800.
// 'Z' A string representing the abbreviation for the time zone.
// 'B' Locale-specific full month name, e.g. "January", "February".
// 'b' Locale-specific abbreviated month name, e.g. "Jan", "Feb".
// 'h' Same as 'b'.
// 'A' Locale-specific full name of the day of the week, e.g. "Sunday", "Monday"
// 'a' Locale-specific short name of the day of the week, e.g. "Sun", "Mon"
// 'C' Four-digit year divided by 100, formatted as two digits with leading zero as necessary, i.e. 00 - 99
// 'Y' Year, formatted as at least four digits with leading zeros as necessary, e.g. 0092 equals 92 CE for the Gregorian calendar.
// 'y' Last two digits of the year, formatted with leading zeros as necessary, i.e. 00 - 99.
// 'j' Day of year, formatted as three digits with leading zeros as necessary, e.g. 001 - 366 for the Gregorian calendar.
// 'm' Month, formatted as two digits with leading zeros as necessary, i.e. 01 - 13.
// 'd' Day of month, formatted as two digits with leading zeros as necessary, i.e. 01 - 31
// 'e' Day of month, formatted as two digits, i.e. 1 - 31.
// common compositions for date/time conversion
// 'R' Time formatted for the 24-hour clock as "%tH:%tM"
// 'T' Time formatted for the 24-hour clock as "%tH:%tM:%tS".
// 'r' Time formatted for the 12-hour clock as "%tI:%tM:%tS %Tp". The location of the morning or afternoon marker ('%Tp') may be locale-dependent.
// 'D' Date formatted as "%tm/%td/%ty".
// 'F' ISO 8601 complete date formatted as "%tY-%tm-%td".
// 'c' Date and time formatted as "%ta %tb %td %tT %tZ %tY", e.g. "Sun Jul 20 16:17:00 EDT 1969".
utils.stringFormat('%s Birthday: %2$tm %2$te,%2$tY',new Array('My',new Date(2009,0,1))) // returns My Birthday: 01 1,2009
utils.stringFormat('The time is: %1$tH:%1$tM:%1$tS',new Array(new Date(2009,0,1,12,0,0))) // returns The time is: 12:00:00
utils.stringFormat('My %s: %2$.0f, my float: %2$.2f',new Array('integer',10)) // returns My integer: 10, my float: 10.00
utils.stringFormat('Today is: %1$tc',new Array(new Date())) // returns current date/time as: Today is: Fri Feb 20 14:15:54 EET 2009
utils.stringFormat('Today is: %tF',new Array(new Date())) // returns current date as: Today is: 2009-02-20 |
|
|
|
|
Table Body (tbody) |
---|
id | stringIndexReplace-String_Number_Number_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringIndexReplace |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(text, i_start, i_size, replacement_text) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Replaces a portion of a string with replacement text from a specified index. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - the text to process {Number} i_start - the start index to work from {Number} i_size - the size of the text to replace {String} replacement_text - the replacement text |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the changed text string |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 'this was a test'
var retval = utils.stringIndexReplace('this is a test',6,2,'was'); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringInitCap |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns all words starting with capital chars. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - the text to process |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 'This Is A Test'
var retval = utils.stringInitCap('This is A test'); |
|
|
|
|
Table Body (tbody) |
---|
id | stringLeft-String_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringLeft |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns a string with the requested number of characters, starting from the left. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - the text to process {Number} i_size - the size of the text to return |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the result text string |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 'this i'
var retval = utils.stringLeft('this is a test',6); |
|
|
|
|
Table Body (tbody) |
---|
id | stringLeftWords-String_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringLeftWords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(text, numberof_words) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the number of words, starting from the left. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - to process {Number} numberof_words - to return |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the string with number of words form the left |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 'this is a'
var retval = utils.stringLeftWords('this is a test',3); |
|
|
|
|
Table Body (tbody) |
---|
id | stringMD5HashBase16-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringMD5HashBase16 |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the md5 hash (encoded as base16) for specified text. NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5 |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the resulting hashString |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var hashed_password = utils.stringMD5HashBase16(user_password) |
|
|
|
|
Table Body (tbody) |
---|
id | stringMD5HashBase64-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringMD5HashBase64 |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the md5 hash (encoded as base64) for specified text. NOTE: MD5 (Message-Digest Algorythm 5) is a hash function with a 128-bit hash value, for more info see: http://en.wikipedia.org/wiki/MD5 |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the resulting hashString |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var hashed_password = utils.stringMD5HashBase64(user_password) |
|
|
|
|
Table Body (tbody) |
---|
id | stringMiddle-String_Number_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringMiddle |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(text, i_start, i_size) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns a substring from the original string. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - the text to process {Number} i_start - the start index to work from {Number} i_size - the size of the text to return |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the result text string |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 'his'
var retval = utils.stringMiddle('this is a test',2,3); |
|
|
|
|
Table Body (tbody) |
---|
id | stringMiddleWords-String_Number_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringMiddleWords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(text, i_start, numberof_words) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns a substring from the original string. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - to process {Number} i_start - start word index {Number} numberof_words - the word count to return |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the string with number of words form the left and |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 'is a'
var retval = utils.stringMiddleWords('this is a test',2,2); |
|
|
|
|
Table Body (tbody) |
---|
id | stringPBKDF2Hash-String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringPBKDF2Hash |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the PBKDF2 hash for specified text. This method is preferred above the old MD5 hash for enhanced security. It uses a default of 2000 iterations. NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2 |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the resulting hashString |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var hashed_password = utils.stringPBKDF2Hash(user_password) |
|
|
|
|
Table Body (tbody) |
---|
id | stringPBKDF2Hash-String_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringPBKDF2Hash |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(textString, iterations) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the PBKDF2 hash for specified text. This method is preferred above the old MD5 hash for enhanced security. NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2 |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process {Number} iterations - how many hash iterations should be done, minimum should be 1000 or higher. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the resulting hashString |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var hashed_password = utils.stringPBKDF2Hash(user_password,5000) |
|
|
|
|
Table Body (tbody) |
---|
id | stringPatternCount-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringPatternCount |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the number of times searchString appears in textString. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - the text to process {String} toSearchFor - the string to search for |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Number - the occurrenceCount that the search string is found in the text |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 2 as count
var count = utils.stringPatternCount('this is a test','is'); |
|
|
|
|
Table Body (tbody) |
---|
id | stringPosition-String_String_Number_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringPosition |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(textString, toSearchFor, i_start, i_occurrence) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the position of the string to search for, from a certain start position and occurrence. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process {String} toSearchFor - the string to search {Number} i_start - the start index to search from {Number} i_occurrence - the occurrence |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 4 as position
var pos = utils.stringPosition('This is a test','s',1,1) |
|
|
|
|
Table Body (tbody) |
---|
id | stringReplace-String_String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringReplace |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(text, search_text, replacement_text) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Replaces a portion of a string with replacement text. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - the text to process {String} search_text - the string to search {String} replacement_text - the replacement text |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the changed text string |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 'these are cow 1 and cow 2.'
var retval = utils.stringReplace('these are test 1 and test 2.','test','cow'); |
|
|
|
|
Table Body (tbody) |
---|
id | stringReplaceTags-String_Object |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the text with %%tags%% replaced, based on provided record or foundset or form. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - the text tags to work with {Object} scriptable - the javascript object or foundset,record,form to be used to fill in the tags |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the text with replaced tags |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //Next line places a string in variable x, whereby the tag(%%TAG%%) is filled with the value of the database column 'company_name' of the selected record.
var x = utils.stringReplaceTags("The companyName of the selected record is %%company_name%% ", foundset)
//var otherExample = utils.stringReplaceTags("The amount of the related order line %%amount%% ", order_to_orderdetails);
//var recordExample = utils.stringReplaceTags("The amount of the related order line %%amount%% ", order_to_orderdetails.getRecord(i);
//Next line places a string in variable y, whereby the tag(%%TAG%%) is filled with the value of the form variable 'x' of the form named 'main'.
//var y = utils.stringReplaceTags("The value of form variable is %%x%% ", forms.main);
//The next sample shows the use of a javascript object
//var obj = new Object();//create a javascript object
//obj['x'] = 'test';//assign an named value
//var y = utils.stringReplaceTags("The value of object variable is %%x%% ", obj);//use the named value in a tag |
|
|
|
|
Table Body (tbody) |
---|
id | stringRight-String_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringRight |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns a string with the requested number of characters, starting from the right. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - the text to process {Number} i_size - the size of the text to return |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the result text string |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 'a test'
var retval = utils.stringLeft('this is a test',6); |
|
|
|
|
Table Body (tbody) |
---|
id | stringRightWords-String_Number |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringRightWords |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(text, numberof_words) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the number of words, starting from the right. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - to process {Number} numberof_words - to return |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the string with number of words form the right |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 'is a test'
var retval = utils.stringRightWords('this is a test',3); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringToNumber |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Filters characters out of from a string and leaves digits, returns the number. Uses locale decimal separator. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Number - the resulting number |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 65567
var retval = utils.stringToNumber('fg65gf567'); |
|
|
|
|
Table Body (tbody) |
---|
id | stringToNumber-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringToNumber |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
(textString, decimalSeparator) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Filters characters out of from a string and leaves digits, returns the number. Decimal separator is specified as parameter. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process {String} decimalSeparator - decimal separator |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Number - the resulting number |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 65.567
var retval = utils.stringToNumber('fg65gf.567','.'); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringTrim |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the string without leading or trailing spaces. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} textString - the text to process |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| String - the resulting trimmed string |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns 'text'
var retval = utils.stringTrim(' text '); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
stringWordCount |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns the number of words in the text string. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} text - the text to process |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| //returns '4' as result
var retval = utils.stringWordCount('this is a test'); |
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
timestampToDate |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Returns a datestamp from the timestamp (sets hours,minutes,seconds and milliseconds to 0). |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {Date} date - object to be stripped from its time elements |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Date - the stripped date object |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| var date = utils.timestampToDate(application.getTimeStamp()); |
|
|
|
|
Table Body (tbody) |
---|
id | validatePBKDF2Hash-String_String |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
validatePBKDF2Hash |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Div |
---|
| Validates the given password against the given hash. The hash should be generated by one of the stringPBKDF2Hash(password [,iteration]) functions. If hash is null or empty string the method will return false. NOTE: PBKDF2 is the key hash function for the PKCS (Public-Key Cryptography) standard, for more info see: http://en.wikipedia.org/wiki/PBKDF2 |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters Div |
---|
| {String} password - the password to test against {String} hash - the hash the password needs to validate to. |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns Div |
---|
| Boolean - true if his hash is valid for that password |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample Div |
---|
| Code Block |
---|
| if (utils.validatePBKDF2Hash(user_password, hashFromDb)) {
// logged in
} |
|
|
|
|
|