rest - Netsuite - 与对象字段相关的自定义列表
问题描述
我能够获取与执行 GET 请求的对象相关的字段:
https://[...].suitetalk.api.netsuite.com/services/rest/record/v1/metadata-catalog/customer
并作为标头发送:接受:application/schema+json
在此响应中,我得到一个名为“custentity_companypublicprivate”的自定义字段,它在 UI 中是一个下拉列表,该下拉列表中的值是一个自定义列表。
手动我能够得到与自定义列表相关的:“customlist_compnaypublicprivate”
但是我需要通过代码来获得这种关系,因为我需要对所有作为自定义列表的字段执行此操作,并且在响应中我找不到任何信息来告诉我哪个是与自定义列表相关的。
这是对象的定义:
"custentity_companypublicprivate": {
"type": "object",
"properties": {
"id": {
"title": "Internal identifier",
"type": "string"
},
"refName": {
"title": "Reference Name",
"type": "string"
},
"externalId": {
"title": "External identifier",
"type": "string"
},
"links": {
"title": "Links",
"type": "array",
"readOnly": true,
"items": {
"$ref": "/services/rest/record/v1/metadata-catalog/nsLink"
}
}
}
}
有没有办法做到这一点?。在此先感谢您的帮助。
解决方案
另一种选择是使用 SuiteQL 进行查询。
https://#########.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&offset=0
询问:
{
"q": "SELECT * FROM CustomField where fieldtype = 'ENTITY'"
}
返回 中的列表/记录 InternalId fieldvaluetyperecord
。
其他查询:
{
"q": "SELECT * FROM CustomRecordType"
}
{
"q": "SELECT * FROM CustomList"
}
{
"q": "SELECT * FROM customlist_compnaypublicprivate"
}
推荐阅读
- r - 如何将 geom_point() 添加到 autolayer() 行?
- jquery - Toggle class on click of parent and exclude click of children
- javascript - HTML 页面不显示该城市不存在
- python - 如何在 Django 物化视图中传输复选框参数?
- css - 如何在 Woocommerce 商店页面的同一行中对齐“价格”和“添加到购物车”按钮?
- sql - SQL Server 游标动态 SQL 'SOURCE.dbo.SRC_KLIENT' 附近的语法不正确
- javascript - 区分数组中的修改对象或聚合
- scala - 如何使用 IO Monad 退出 For-Comprehension
- javascript - 假设我有两个包含相关数据的数组。如何搜索第一个数组并返回数组 1 和数组 2 之间合并的相关数据?
- vue.js - Vue-Native 复选框更改值