This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ name: "Robin", age: 30 }, | |
{ name: "Theo", age: 24 }, | |
{ name: "Bacary", age: 28 } | |
].sort(function(obj1, obj2) { | |
// Ascending: first age less than the previous | |
return obj1.age - obj2.age; | |
}); | |
// Returns: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Update the project total budget hours using | |
* the hours field on project budget transactions. | |
* | |
* Version Date Author Remarks | |
* 1.00 20 Feb 2014 Ryan Morrissey | |
* | |
*/ | |
function updateProjectBudgetHours(type) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple url validation for custom field. | |
* | |
* Version Date Author Remarks | |
* 1.00 20 Feb 2014 Ryan Morrissey | |
* | |
*/ | |
function validateURL() { | |
var url = NSOA.form.getValue('custom_30'), | |
re = /^(ftp|http|https):\/\/[^ "]+$/, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a project issue for a change order task if one | |
* isn't already created. | |
* | |
* Version Date Author Remarks | |
* 1.00 20 Feb 2014 Ryan Morrissey | |
* | |
*/ | |
function createChangeOrderIssue(type) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright NetSuite, Inc. 2014 All rights reserved. | |
* The following code is a demo prototype. Due to time constraints of a demo, | |
* the code may contain bugs, may not accurately reflect user requirements | |
* and may not be the best approach. Actual implementation should not reuse | |
* this code without due verification. | |
* | |
* This script uses a custom field to append notes to the standard | |
* notes field on a record. It can be reused for multiple complex | |
* record types by modifying the variables at the start of the function. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
GREEN:WorkComplete=100||Status=Completed | |
BLUE:WorkComplete<>100;EndDate>today | |
ORANGE:WorkComplete<>100;EndDate=today | |
RED:WorkComplete<>100;EndDate<today | |
@green:#afc437; | |
@blue:#428bca; | |
@orange:#f89406; | |
@red:#bf340f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
GREEN:WorkComplete=100||Status=Completed | |
BLUE:WorkComplete<>100;StartDate>today | |
ORANGE:WorkComplete<>100;StartDate=today | |
RED:WorkComplete<>100;StartDate<today | |
@green:#afc437; | |
@blue:#428bca; | |
@orange:#f89406; | |
@red:#bf340f; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'<style>.progress{overflow:hidden;height:18px;background-color:#ccc;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);}.progress-bar{float:left;width:0;height:100%;font-size:11px;line-height:18px;color:#fff;text-align:center;background-color:#428bca;box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;transition:width .6s ease;-moz-transition:width .6s ease;}</style><div class="progress">' || '<div class="progress-bar" style="width:' || CASE WHEN ROUND({percenttimecomplete}*100, 1) >= 100.0 THEN 100 ELSE ROUND({percenttimecomplete}*100, 1) END || '%;"> ' || ROUND({percenttimecomplete}*100, 1) || '%</div></div>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'<style>.progress{overflow:hidden;height:18px;background-color:#ccc;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);}.progress-bar{float:left;width:0;height:100%;font-size:11px;line-height:18px;color:#fff;text-align:center;background-color:#428bca;box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;transition:width .6s ease;-moz-transition:width .6s ease;}</style><div class="progress">' || '<div class="progress-bar" style="width:' || ROUND({percentworkcomplete}*100, 1) || '%;"> ' || ROUND({percentworkcomplete}*100, 1) || '%</div></div>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(TO_CHAR({enddate},'J') - TO_CHAR({startdate},'J'))+1 - ((((TRUNC({enddate},'D'))-(TRUNC({startdate},'D')))/7)*2) - (CASE WHEN TO_CHAR({startdate},'DY','nls_date_language=english')='SUN' THEN 1 ELSE 0 END) - (CASE WHEN TO_CHAR({enddate},'DY','nls_date_language=english')='SAT' THEN 1 ELSE 0 END) |
OlderNewer