使用SuiteScript 2.0获取应用记录的实际记录

问题描述 投票:0回答:1

我希望能够在执行客户退款之类的操作时从应用的记录中获取送货/账单地址。

这是我从应用记录中看到的数据:

amount = {string} 2.56
apply = {string} T
applydate = {string} 11/6/2018
createdfrom = {object} null
doc = {string} 792
due = {string} 2.56
duedate = {object} null
internalid = {string} 792
line = {string} 1
pymt = {object} null
refnum = {string} 63
sys_id = {string} 4917587510484347
sys_parentid = {string} 4917587510342093
total = {string} 2.56
trantype = {string} CustPymt
type = {string} Payment

我最初尝试使用record.Load函数来执行此操作。问题在于此函数需要传入记录类型,而在apply子列表中没有明确给出。我最初尝试使用type字段,但是如您在上面看到的。正确的类型为record.Type.CUSTOMER_PAYMENT,此处的值仅显示为Payment。我改用trantype并具有映射功能,但我并没有所有可能的映射。

我的问题是:

  1. 是否有从应用记录中获取运输和帐单信息的更好的方法
  2. 如果对1的答案为否,是否有办法从apply子列表中获取实际的记录类型?
  3. 如果对2的答案为否,那么是否有某个地方可以将trantype映射到record.Type
netsuite suitescript2.0
1个回答
0
投票

您可以使用search.Type.TRANSACTION如下查找地址值:

    var addressValues = search.lookupFields({
        type: search.Type.TRANSACTION,
        id: 792,
        columns: ['shipaddress', 'billaddress']
    });
© www.soinside.com 2019 - 2024. All rights reserved.