我正在逐行解析一个大文件,读取每行中的子串.我将从每个子字符串中获取一个整数值,每行约30个,并且需要从文件中返回最高的5个值.什么样的数据结构最有效地跟踪5个最大值?
我正在创建一个简单的 Suitelet,在第一页上,用户输入订单 # 并单击“搜索”。这将重定向到将行项目信息加载到子列表的页面。在保存这些更改之前,用户可以从那里编辑一些行项目字段。一切都可以保存更改...
我的 Suitelet 脚本如下所示:
/**
* @NApiVersion 2.x
* @NScriptType Suitelet
*/
define(['N/search', 'N/ui/serverWidget', 'N/format', 'N/redirect', 'N/https', 'N/record', 'N/error'],
function(s, ui, format, redirect, https, record, error) {
function onRequest_(context) {
try {
if (context.request.method === 'GET') {
showForm(context);
} else {
showResults(context);
}
} catch (e) {
log.error('onRequest_', 'ERROR : ' + e.message);
var errObj = error.create({
name : 'SL ERROR',
message : e.message,
notifyOff : true
});
throw 'ERROR: ' + e.message;
}
}
function showForm(context) …Run Code Online (Sandbox Code Playgroud)