来自 NetSuite 的 SuiteQL 查询响应中键入的值出现问题

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

我目前正在使用 NetSuite 的 REST API 从自定义记录中检索数据。我正在使用 Postman 进行测试。当我使用 REST 端点请求数据时,我会收到预期的键入值。这是响应的示例:

{
    "links": [
        {
            "rel": "self",
            "href": "https://sb1.suitetalk.api.netsuite.com/services/rest/record/v1/CUSTOMRECORD_TEST/1"
        }
    ],
    "created": "2022-09-21T17:21:00Z",
    "custrecord_value": 5000.0,
    "id": "1",
    "isInactive": false //This is correctly represented as a boolean
}

但是,当我尝试使用 SuiteQL 检索相同的数据时,所有值都被解析为响应中的字符串,甚至是布尔值。以下是 SuiteQL 请求和响应的示例:

要求:

{"q": "SELECT * FROM CUSTOMRECORD_TEST where id=1"}

回应:

{
    "links": [
        {
            "rel": "self",
            "href": "https://sb1.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql"
        }
    ],
    "count": 1,
    "hasMore": false,
    "items": [
        {
            "links": [],
            "created": "21/09/2022",
            "custrecord_value": "5000",
            "id": "1",
            "isinactive": "F", //The boolean value is represented as a string "F"
        }
    ],
    "offset": 0,
    "totalResults": 1
}

我想知道在使用 SuiteQL 查询时是否有办法接收键入的值(尤其是布尔值)。我的配置或查询语法中是否遗漏了某些内容?任何帮助或指导将不胜感激。

谢谢!

postman suiteql
1个回答
0
投票

答案是:你不能。

使用 SuiteQL 调用 NetSuite 时,我们必须手动解析它。

© www.soinside.com 2019 - 2024. All rights reserved.