搜索中的NetSuite Web Services自定义字段

本文关键字:Services 自定义 字段 Web NetSuite 搜索 | 更新日期: 2023-09-27 17:58:52

我似乎无法使用Web服务提取事务搜索的自定义字段值。

        searchTransaction.savedSearchId = "2017";
        SearchResult result = netsuite.search(searchTransaction);
        if(result.status.isSuccess)
        {
            SearchRow[] searchRows = result.searchRowList;
            if(searchRows != null && searchRows.Length >= 1)
            {
                for (int i = 0; i < searchRows.Length; i++)
                {
                    TransactionSearchRow transactionRow = (TransactionSearchRow)searchRows[i];
                    var iid = transactionRow.basic.internalId[0].searchValue;
                    double amount = transactionRow.basic.amount[0].searchValue;
                    string custfild = transactionRow.basic.customFieldList[0].scriptId;
                    Console.WriteLine("'n Transaction ID: " + iid.internalId);
                    Console.WriteLine("'n Amount: " + amount.ToString());
                    Console.WriteLine("'n customfield: " + custfield.ToString());
                }
            }
        }

我知道返回该字段是因为我可以在xml响应中看到它。还有custfield。ToString()确实返回自定义字段的内部ID。

我只是似乎无法得到实际价值。

搜索中的NetSuite Web Services自定义字段

想好了,发布以防其他人有同样的问题:

        searchTransaction.savedSearchId = "2017";
        SearchResult result = netsuite.search(searchTransaction);
        if(result.status.isSuccess)
        {
            SearchRow[] searchRows = result.searchRowList;
            if(searchRows != null && searchRows.Length >= 1)
            {
                for (int i = 0; i < searchRows.Length; i++)
                {
                    TransactionSearchRow transactionRow = (TransactionSearchRow)searchRows[i];
                    var iid = transactionRow.basic.internalId[0].searchValue;
                    double amount = transactionRow.basic.amount[0].searchValue;
                    string custfild = transactionRow.basic.customFieldList[0].scriptId;
                    SearchColumnStringCustomField custfild =  (SearchColumnStringCustomField)transactionRow.basic.customFieldList[0];
                    Console.WriteLine("'n Transaction ID: " + iid.internalId);
                    Console.WriteLine("'n Amount: " + amount.ToString());
                    Console.WriteLine("'n custfild: " + custfild.searchValue);
                }
            }
        }