- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何从表单的子列表中检索所有数据?即,理想情况下,将子列表中的所有行检索为一个对象数组
。
/**
* @NApiVersion 2.x
* @NScriptType Suitelet
* @NModuleScope SameAccount
*/
define(['N/ui/serverWidget',
'N/email',
'N/runtime',
'N/search',
'N/file',
'N/log'],
/**
* @param {ui} ui
* @param {email} email
* @param {runtime} runtime
* @param {search} search
* @param {file} file
* @param {log} log
*/
function(ui, email, runtime, search, file, log) {
function onRequest(context) {
// On GET I create a form and add a sublist inline editor to it.
if (context.request.method === 'POST') {
var sublistData = context.request.parameters.sublistdata;
// sublistData is not an array its funny string. See below:
// 2017-5-16\u000111\u00012017-5-19\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u00011\u0001\u0001Me\u0001\u0001\u0001\u0001\u00012\u0001\u0001F\u0001\u0001\u0001INSERT\u00011\u0001F\u0001\u0001\u0001\u0001\u0001\u00022017-5-22\u000111122122\u00012017-5-12\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u0001\u00011\u0001\u0001Me\u0001\u0001\u0001\u0001\u00012\u0001\u0001F\u0001\u0001\u0001INSERT\u00011\u0001F\u0001\u0001\u0001\u0001\u0001
//How can I get the sublist row data in a better format?
}
}
return {
onRequest: onRequest
};
});
最佳答案
发生的事情是 NetSuite 通过不可打印的 Unicode 控制字符 \u0001
(字段之间)和 \u0002
(行之间)分隔请求对象中的子列表值.
您可以使用 request.getLineCount()
和 request.getSublistValue()
来检索结果。
var lines = context.request.getLineCount({ group: "sublist" });
for(var i = 0; i < lines; i++) {
var field1 = context.request.getSublistValue({ group: 'sublist', name: 'field1', line: i });
var field2 = context.request.getSublistValue({ group: 'sublist', name: 'field2', line: i });
}
关于netsuite - 获取子列表行数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43904481/
我们正在考虑将开发人员从生产中剔除,并需要一种简单的部署管理工具。一些成员在 SalesForce 中使用的一项建议是Jenkins。我以前从未使用过 Jenkins 或任何类型的部署工具。我通常只是
我在 NetSuite 中的 Transaction 对象上创建了一个简单的已保存搜索,但由于某种原因,我看到返回了重复的结果。下面的屏幕截图显示了同一交易记录的重复结果。 任何人都可以帮助我理解为什
请参阅 NetSuite 的 SuiteScript 2.0 API 文档。要设置子列表字段的值,请在 STANDARD 模式下使用“Record.setSublistValue(options)”。
我们正在考虑将开发人员从生产中剔除,并需要一种简单的部署管理工具。一些成员在 SalesForce 中使用的一项建议是Jenkins。我以前从未使用过 Jenkins 或任何类型的部署工具。我通常只是
请参阅 NetSuite 的 SuiteScript 2.0 API 文档。要设置子列表字段的值,请在 STANDARD 模式下使用“Record.setSublistValue(options)”。
我收到了来自 Netsuite 的自动电子邮件错误。 Account: 45447 Environment: SandBox Date & Time: 7/20/2017 3:55 pm Record
我正在尝试通过 API 列出发货项目(UPS、FedEx 等)。正如 Accounting > Shipping Items > List 中所示. ItemFulfillment Record 的文
有没有办法在 Netsuite 中使用 API(SOAP 或 REST)获取所有记录类型的列表 - 标准和自定义(员工、潜在客户、客户等)及其字段? 最佳答案 通过 列出所有支持的记录Suitescr
有没有办法获取 Netsuite 帐户中可用的角色列表?我正在使用 Netsuite 开发配置解决方案,我对 netsuite 还很陌生。如果有人能指出我可以获得角色列表(员工角色?)的 API,那将
我在自定义记录上有一个字段。该字段的名称是 reference_code。 我想用我自己的动态列表填充“reference_code”,该列表将作为下拉列表显示给用户。 我该怎么做?我将我的字段定义为
如何使用 SuiteTalk 获取 NetSuite 中所有支持的记录类型? 描述:我需要 netsuite 帐户中支持的所有记录类型(对象)的列表。我正在尝试使用 java 集成 netsuite
如何访问子列表中的数据。地址子选项卡包含我需要阅读的信息。例如地址簿中存储的地址 2 字段。我需要检索此数据并将其传递到销售订单表单上的自定义文本框。我可以从销售主体字段中读取,但是当我尝试子列表时,
我需要在 NetSuite 中验证内联编辑。 我已经有一个客户端脚本,在正常编辑记录时效果很好。 我尝试在保存之前的功能上添加一个用户事件脚本来验证记录,但内联编辑似乎会忽略这一点。 有人遇到过这种情
有没有办法获取 Netsuite 帐户中可用的角色列表?我正在使用 Netsuite 开发配置解决方案,我对 netsuite 还很陌生。如果有人能指出我可以获得角色列表(员工角色?)的 API,那将
我在自定义记录上有一个字段。该字段的名称是 reference_code。 我想用我自己的动态列表填充“reference_code”,该列表将作为下拉列表显示给用户。 我该怎么做?我将我的字段定义为
我试图以编程方式触发工作流, nlapiTriggerWorkflow(recType, recId, workflowId, actionId, stateId) 但是我得到了, "nlapiTri
我们使用的是suitscript 2.0。我们希望定期从 netsuite 读取自定义报告并将数据保存到第三方系统中。似乎搜索模块和记录模块都无法加载/读取报告数据。是否可以以编程方式获取报告数据?
如何创建一个 SuiteTalk (NetSuite web api) 搜索查询,指定多个搜索词来指示逻辑 OR 运算符? 例如,我想检索其创建或上次修改日期在特定范围内的 TimeBill 记录。这
我在我的 netsuite 站点上部署了一个 ReSTLet,但似乎无法通过管理员之外的任何角色访问它。 Your role does not give you permission to view
我需要清除/重置 NetSuite 中记录上的外部 ID,但我所做的一切都不起作用。 某些 InventoryItem 记录被错误地映射到另一个系统中的记录。我有一个可以同步两个系统的应用程序,但我需
我是一名优秀的程序员,十分优秀!