1

我能够获取与执行 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"
                    }
                }
            }
        }

有没有办法做到这一点?。在此先感谢您的帮助。

4

1 回答 1

1

另一种选择是使用 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"
}
于 2021-06-14T20:34:29.633 回答