Hi All,
I have a script portlet which is loading a currency value from a custom record, I want to display the value formatted correctly for currency i.e 13210.00 13,210.00.
I have looked at this page http://josscrowcroft.github.io/accounting.js/ which has a script file that can be used but I am having trouble calling it into my script to use it's function. Is it even possible to call a function from another .js file in Netsuite suitescript??
Any help gratefully received. My Code below for the portlet.
function ASIP_NEW(portlet, column) { portlet.setTitle('Assessment Services Information - New') //var today = new Date(); var today = new Date(); var date = today.getDate(); var Month = today.getMonth(); nlapiLogExecution('DEBUG', 'Date', date ); nlapiLogExecution('DEBUG', 'Month', Month ); //Start Of Details Capture if (Month == 0) { //Get Month 0 Record - January var MonthRecID = 1; } if (Month == 1) { //Get Month 1 Record - February var MonthRecID = 2; } if (Month == 2) { //Get Month 1 Record - March var MonthRecID = 3; } if (Month == 3) { //Get Month 1 Record - April var MonthRecID = 4; } if (Month == 4) { //Get Month 1 Record - May var MonthRecID = 5; } if (Month == 5) { //Get Month 1 Record - June var MonthRecID = 6; } if (Month == 6) { //Get Month 1 Record - July var MonthRecID = 7; } if (Month == 7) { //Get Month 1 Record - August var MonthRecID = 8; } if (Month == 8) { //Get Month 1 Record - September var MonthRecID = 9; } if (Month == 9) { //Get Month 1 Record - October var MonthRecID = 10; } if (Month == 10) { //Get Month 1 Record - November var MonthRecID = 11; } if (Month == 11) { //Get Month 1 Record - December var MonthRecID = 12; } var dateRecord = nlapiLoadRecord('customrecord_mt_dash',MonthRecID); nlapiLogExecution('DEBUG', 'Date Record', dateRecord); var monthTarget = dateRecord.getFieldValue('custrecord_mtd_month_target'); nlapiLogExecution('DEBUG', 'Month target', monthTarget); var workingDaysRemain = dateRecord.getFieldValue('custrecord_mtd_working_days_remaining'); nlapiLogExecution('DEBUG', 'Working Days Remaining', workingDaysRemain); var DaysTarget = dateRecord.getFieldValue('custrecord_mtd_todays_target'); nlapiLogExecution('DEBUG', 'Days Target', DaysTarget); var MonthRound = Math.round(monthTarget); var TargetRound = Math.round(DaysTarget); var html = '<style type="text/css">' + '.style3 {font-family: Arial, Helvetica, sans-serif; font-size: 18px; }' + '.style5 {font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold; }' + '</style>' + '<table width="25%" border="0" cellspacing="0" cellpadding="0" align="center">' + '<tr>' + '<td align="center"><span class="bigboldtext">Months Target: &pound' + MonthRound + '</span></td>' + '</tr>' + '<tr>' + '<td align="center"><span class="bigboldtext">Days Target: &pound' + TargetRound + '</span></td>' + '</tr>' + '<tr>' + '<td align="center"><span class="bigboldtext">Invoicing Days Left: ' + workingDaysRemain + '</span></td>' + '</tr>' + '</table>'; html='<td><span>'+ html +'</span></td>' portlet.setHtml( html ); }