【问题标题】:Query with RefNumberList for invoice QuickBooks QBFC使用 RefNumberList 查询发票 QuickBooks QBFC
【发布时间】:2014-01-21 19:39:59
【问题描述】:

我正在开发一个程序,该程序将使用一组发票编号查询 Quickbooks,然后针对每个发票编号。将获得发票,发票号码将主要来自文件。快本中没有匹配记录的号码将被保存到另一个文件中。

现在我在 RefNumberList 中添加了所有发票编号,因为我在以下示例中硬编码了两个数字

IInvoiceQuery Invoices = msgset.AppendInvoiceQueryRq();
Invoices.ORInvoiceQuery.RefNumberList.Add("144");
Invoices.ORInvoiceQuery.RefNumberList.Add("9999");

msgset.Attributes.OnError = ENRqOnError.roeContinue;

if (sessionMgr.doRequests(ref msgset))
{
     MessageBox.Show("An error was detected while processing the request. Please check the log files");
     return;
}

主要的问题是,即使任何一个发票号码都没有在快本中记录,整个查询都会失败。

【问题讨论】:

    标签: c# quickbooks qbfc


    【解决方案1】:

    我建议您将每张发票单独提出请求。这样,您仍然可以让其他查询返回一个值。

    msgset.Attributes.OnError = ENRqOnError.roeContinue;
    string[] InvoiceList = { "144", "9999" };
    foreach (string invNum in InvoiceList)
    {
        IInvoiceQuery invQuery = msgset.AppendInvoiceQueryRq();
        invQuery.ORInvoiceQuery.RefNumberList.Add(invNum);
    }

    // 处理请求并获得响应 IMsgSetResponse MsgResponse = SessionManager.DoRequests(msgset);

    // 检查每个响应 for (int index = 0; index

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多