在netsuite suitescript 1.0中,我想检查一个字符串是否有一组关键字.在javascript中有一个名为.includes的函数("Set_of_keywords_to_be_searched"); 我试过.include在netsuite但它给出错误.
例如:
var str = "Hello world, welcome to the javascript.";
var n = str.includes("world"); // this will return true
var n = str.includes("Apple"); // this will return false
Run Code Online (Sandbox Code Playgroud)
我想在netsuite中使用类似的功能.
我开始学习Netsuite,因为这是我们的新项目所必需的.我是全新的.目前我正在研究PHP.
根据我的经理的建议,我在其上创建了开发者帐户.但我对它没有任何想法.因此,如果有人能够回答我的下面的问题而不是我会非常感激.
提前致谢.高兴
我在 suitelet 中创建了一个 excel 文件。我想在 Excel 文件中传递动态值,那么我该怎么做呢?例如:我想通过:
var transaction_id = searchresult.getValue("internalid",'transaction');
Run Code Online (Sandbox Code Playgroud)
在 Excel 文件中。
我尝试了下面的方法,但它抛出损坏的文件错误。*注意:将动态数据传递到文件时,会生成包含静态数据的文件。
var xmlStr = '<?xml version="1.0"?><?mso-application progid="Excel.Sheet"?>';
xmlStr += '<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" ';
xmlStr += 'xmlns:o="urn:schemas-microsoft-com:office:office" ';
xmlStr += 'xmlns:x="urn:schemas-microsoft-com:office:excel" ';
xmlStr += 'xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" ';
xmlStr += 'xmlns:html="http://www.w3.org/TR/REC-html40">';
xmlStr += '<Worksheet ss:Name='sheet_name'>';
//Below mention is the place(transaction_id) where I want to pass the dynamic value
xmlStr += '<Table>' +
'<Row>' +
'<Cell><Data ss:Type="String">transaction_id</Data></Cell>' +
'</Row>';
xmlStr += '</Table></Worksheet></Workbook>';
var xlsFile = nlapiCreateFile('sheet_name.xls', 'EXCEL', nlapiEncrypt(xmlStr, 'base64'));
xlsFile.setFolder(6157);
var …Run Code Online (Sandbox Code Playgroud)