【问题标题】:NetSuite Transaction DatesNetSuite 交易日期
【发布时间】:2017-11-29 19:43:36
【问题描述】:

NetSuite 交易中有很多日期可供选择,特别是销售订单。我正在使用 SuiteTalk 将运输信息从 NetSuite 同步到旧系统。哪个日期是确定针对销售订单发生活动以指示已发货的正确日期?

【问题讨论】:

    标签: netsuite suitetalk saved-searches


    【解决方案1】:

    在查看并比较了所有销售订单中的所有日期值后,我得出的结论是,没有明确的赢家可以显示其最后一次活动的日期/时间。公式字段是最好的解决方案。这是演示该公式的已保存搜索。

    请注意下面的公式,它可以从所有相关日期中找到最大日期。

    此计算日期还可用于筛选器,以仅查找最近修改的销售订单项目,特别是那些与跟踪号和数量一起发货的项目。

    这是可以剪切和粘贴格式的公式。

    GREATEST({trandate},{lastmodifieddate},{linelastmodifieddate},{billingtransaction.trandate},{billingtransaction.lastmodifieddate},{billingtransaction.linelastmodifieddate})

    【讨论】:

    • 这个解决方案有问题。 {linelastmodifieddate} 不能通过 SuiteTalk 和 SuiteTalk API 使用。我联系了 NetSuite,他们确认了这一点,并表示会将其添加到请求的增强列表中。
    【解决方案2】:

    看看你能不能找到 {shipdate} 或 {actualshipdate}

    【讨论】:

    • 问题是我从保存的搜索中的销售订单开始,我想知道已发货的商品。这包括我们在内部完成和直接发货的物品。销售订单和开票交易字段(发票)之间的关系显示了正确的数量以及每批货物的跟踪编号。无论物品是否已履行或直接发货,都是如此。我正在寻找一种方法来拉货(两种类型),我可以在其中显示所选销售订单的销售订单号、项目、发货日期、发货数量和跟踪号。
    【解决方案3】:

    联系 NetSuite 支持后,我了解到 {linelastmodifieddate} 无法通过 SuiteTalk API 获得。这给我留下了以下日期:

    {trandate}
    {lastmodifieddate}
    {billingtransaction.trandate}
    {billingtransaction.lastmodifieddate}
    

    就我而言,我正在监控所有销售订单,以查看商品何时发货。所以我想知道我们什么时候在内部完成一个订单项,或者我们什么时候直接发货。我遇到的问题是这些日期到处都是。我想包括 {linelastmodifieddate},因为有时它是最近的。

    由于我们在商品发货或直接发货时开具发票,因此 {billingtransaction.trandate} 代表准确的发货日期。 {billingtransaction.quantity} 代表准确的发货数量。 {billingtransaction.trackingnumbers} 包含该货件的跟踪编号列表。这就是我查看销售订单中每个订单项的“发货状态”所需的全部信息。

    这是我开始使用的一些示例代码,用于识别最近发货的销售订单。

            service.searchPreferences = new SearchPreferences();
            service.searchPreferences.bodyFieldsOnly = false;
            service.searchPreferences.returnSearchColumns = true;
    
            TransactionSearchAdvanced customSearch = new TransactionSearchAdvanced()
            {
                savedSearchScriptId = "customsearch_[your saved search here]"
                ,criteria = new TransactionSearch()
                {
                   [your criteria here]
                }
    
            };
    
            Console.WriteLine("Querying NetSuite");
            SearchResult res = service.search(customSearch);
    
            Console.WriteLine("\nThe search() operation completed successfully.");
            Console.WriteLine("  Total Records = " + res.totalRecords);
            Console.WriteLine("  Total Pages = " + res.totalPages);
            Console.WriteLine("  Page Size = " + res.pageSize);
            Console.WriteLine("  Current Page Index = " + res.pageIndex);
    
            List<TransactionSearchRow> tsRows = new List<TransactionSearchRow>();
    
            // Page through all the results
            while (res.searchRowList.Length > 0)
            {
                foreach (TransactionSearchRow transactionRow in res.searchRowList)
                {
                    tsRows.Add(transactionRow);
                }
    
                Console.WriteLine("\nQuerying NetSuite again...");
                res = service.searchMore(++res.pageIndex);
            }
    
            // Sort the results
            tsRows.Sort(delegate (TransactionSearchRow x, TransactionSearchRow y)
            {
                return x.basic.tranId[0].searchValue.CompareTo(y.basic.tranId[0].searchValue);
            });
    
            int i = 1;
    
            // Parse the results
            foreach (TransactionSearchRow tsRow in tsRows)
            {
                TransactionSearchRowBasic transactionRowBasic = tsRow.basic;
                ItemSearchRowBasic itemRowBasic = tsRow.itemJoin;
                TransactionSearchRowBasic billingRowBasic = tsRow.billingTransactionJoin;
    
                string itemItemId = "";
                string itemDesc = "";
                double reqQty = 0;
                string billTranId = "";
                double billQty = 0;
                string billTrackNo = "";
    
                try { itemItemId = itemRowBasic.itemId[0].searchValue; } catch { }
                try { itemDesc = itemRowBasic.salesDescription[0].searchValue; } catch { }
                try { reqQty = transactionRowBasic.quantity[0].searchValue; } catch { }
                try { billTranId = billingRowBasic.tranId[0].searchValue; } catch { }
                try { billQty = billingRowBasic.quantity[0].searchValue; } catch { }
                try { billTrackNo = billingRowBasic.trackingNumbers[0].searchValue; } catch { }
    
                DateTime trandate = DateTime.MinValue;
                DateTime lastmodifieddate = DateTime.MinValue;
                DateTime billtrandate = DateTime.MinValue;
                DateTime billlastmodifieddate = DateTime.MinValue;
    
                try { trandate = transactionRowBasic.tranDate[0].searchValue; } catch { }
                try { lastmodifieddate = transactionRowBasic.lastModifiedDate[0].searchValue; } catch { }
                try { billtrandate = billingRowBasic.tranDate[0].searchValue; } catch { }
                try { billlastmodifieddate = billingRowBasic.lastModifiedDate[0].searchValue; } catch { }
    
                var list = new List<DateTime>();
                list.Add(Convert.ToDateTime(trandate));
                list.Add(Convert.ToDateTime(lastmodifieddate));
                list.Add(Convert.ToDateTime(billtrandate));
                list.Add(Convert.ToDateTime(billlastmodifieddate));
                DateTime maxdate = list.Max(date => date);
    
    
                Console.WriteLine(
                    $"\n {i++} of {tsRows.Count}" +
                    $"\n    Document Number: {transactionRowBasic.tranId[0].searchValue}" +
                    $"\n    SO Date: {trandate}" +
                    $"\n    SO Modified: {lastmodifieddate}" +
                    $"\n    Invoice Date: {billtrandate}" +
                    $"\n    Invoice Modified: {billlastmodifieddate}" +
                    $"\n    +++Max Date: {maxdate}" +
                    $"\n    Item Name: {itemItemId}" +
                    $"\n    Item Description: {itemDesc}" +
                    $"\n    Bill Doc Number: {billTranId}" +
                    $"\n    Requested Qty: {reqQty}" +
                    $"\n    Bill Qty: {billQty}" +
                    $"\n    Tracking Nos: {billTrackNo}"
                );
    
            }
    
            service.logout();
            Console.WriteLine("\n\nHit Enter to close this window.");
            Console.ReadLine();
    

    【讨论】:

      猜你喜欢
      • 2017-04-24
      • 1970-01-01
      • 1970-01-01
      • 2021-11-26
      • 2020-11-17
      • 2023-01-30
      • 1970-01-01
      • 2014-12-03
      • 2023-04-11
      相关资源
      最近更新 更多