创建一个 SuiteTalk 事务搜索以获取具有特定状态的所有销售订单

Create a SuiteTalk transaction search that gets all sales order with a certain status

在 NetSuite SuiteTalk(Web 服务)中,我正在尝试创建一个搜索,以查找状态为 "Pending Approval" 的所有销售订单。我认为我的所有结构都正确,我认为问题是状态实际上没有被称为 "Pending Approval, but something else. I have tried other variants like "_pendingApproval",但我的搜索从来没有 returns 任何结果。如果我注释掉状态部分,搜索有效正确地 returns 此特定客户的每个销售订单。

有什么问题吗?

C#


TransactionSearchBasic tsb = new TransactionSearchBasic() {
    mainLine = new SearchBooleanField() {
        searchValue = true,
        searchValueSpecified = true,
    },
    type = new SearchEnumMultiSelectField() {
        @operator = SearchEnumMultiSelectFieldOperator.anyOf,
        operatorSpecified = true,
        searchValue = new string[] { "_salesOrder" },    
    },
    entity = new SearchMultiSelectField() {
        @operator = SearchMultiSelectFieldOperator.anyOf,
        operatorSpecified = true,
        searchValue = new RecordRef[] {
            new RecordRef() {
                type = RecordType.customer,
                internalId = "231"
            }
        }
    },
    status = new SearchEnumMultiSelectField() {
        @operator = SearchEnumMultiSelectFieldOperator.anyOf,
        operatorSpecified = true,
        searchValue = new string[] {
            "Pending Approval",
            "_pendingApproval",
            "pendingApproval",
            "pendingapproval",
            "pending approval",
            "0"
        }
    }
};

SearchResult results = _nss.search(tsb);

尝试使用:

"pendingApproval"

而不是

"_pendingApproval" & "Pending Approval"

看来交易类型需要在状态前加上前缀。例如:

status = new SearchEnumMultiSelectField() {
    @operator = SearchEnumMultiSelectFieldOperator.anyOf,
    operatorSpecified = true,
    searchValue = new string[] {
        "_salesOrderPendingApproval"
    }

}