-1

我正在尝试从给定位置(仓库)搜索 bin 编号 =“1”。我的代码就像

        RecordRef[] referLocation = new RecordRef[1] { new RecordRef { } };
        referLocation[0].type = RecordType.location;
        referLocation[0].internalId = "6";

        BinSearch bSearch = new BinSearch();
        BinSearchBasic bSBasic = new BinSearchBasic();
        SearchStringField strField = new SearchStringField ();
        SearchMultiSelectField multiSelect = new SearchMultiSelectField();

        multiSelect.searchValue = referLocation;
        bSBasic.location = multiSelect;
        strField.searchValue = "1";
        bSBasic.binNumber = strField;
        bSearch.basic = bSBasic;

        var response = _service.search(bSearch);
        if (response.status.isSuccess)
            Console.WriteLine(strField.searchValue + "exists");
        else
            Console.WriteLine(strField.searchValue + "Not exists");

但即使 bin 编号 = 1 在 te netsuite 中,它也会给出 Not Exists。谁能帮我指出代码中的错误或缺失?谢谢

4

2 回答 2

0

您没有在任何搜索条件中提供运算符,请在基本搜索中传递搜索值之前将这些行添加到您的代码中:

multiSelect.@operator = SearchMultiSelectFieldOperator.anyOf;
multiSelect.operatorSpecified = true;

strField.@operator = SearchStringFieldOperator.@is;
strField.operatorSpecified = true;
于 2013-09-11T07:41:36.133 回答
0

我发现的一件事是,如果一条记录在 NetSuite 中被标记为“非活动”,则它不会在任何 API 搜索中返回,并且任何传递该 ID 的添加/更新调用都将失败。

于 2012-10-26T16:21:00.800 回答