创建一个SuiteTalk交易搜索,以获取具有特定状态

时间:2015-07-03 02:43:24

标签: c# web-services netsuite

在NetSuite SuiteTalk(Web服务)中,我正在尝试创建一个搜索,以查找状态为"待批准"的所有销售订单。我认为我的所有内容都是正确的,我认为问题是状态实际上并没有被称为"待批准,而是其他。我尝试了其他变体,如" _pendingApproval",但我的搜索从未返回任何结果。如果我注释掉状态部分,搜索将正常运行并返回此特定客户的每个销售订单。

关于问题是什么的任何想法?

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);

2 个答案:

答案 0 :(得分:1)

看起来交易类型需要以状态为前缀。例如:

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

}

答案 1 :(得分:0)

尝试使用:

"pendingApproval"

而不是

"_pendingApproval" & "Pending Approval"