我希望能够在执行客户退款之类的操作时从应用的记录中获取送货/账单地址。
这是我从应用记录中看到的数据:
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
并具有映射功能,但我并没有所有可能的映射。
我的问题是:
trantype
映射到record.Type
?您可以使用search.Type.TRANSACTION如下查找地址值:
var addressValues = search.lookupFields({
type: search.Type.TRANSACTION,
id: 792,
columns: ['shipaddress', 'billaddress']
});