3

QuickBooks QBFC を使用してカスタム SO 請求書テンプレート フィールドを取得したいと考えています。

4

2 に答える 2

2

Paul Keister の回答を詳しく説明すると、クエリに「0」を追加する必要があるのは、それが取得しようとしているカスタム フィールドの所有者 ID であるためです。おそらく値は 0 ですが、所有者 ID が異なる場合は、ここで別の値を使用する必要があります。

C# コードの例:

//set the owner id of the custom field you are trying to get back
IInvoiceQuery invoiceQuery = requestMsgSet.AppendInvoiceQueryRq();
invoiceQuery.OwnerIDList.Add("0");

//set up query parameters and actually call your query...

//call this method for each invoice to get its custom fields (if they exist)
static void GetInvoiceCustomFields(IInvoiceRet invoice)
    {
        if (invoice.DataExtRetList == null)
        {
            return;
        }

        for (int i = 0; i < invoice.DataExtRetList.Count; i++)
        {
            IDataExtRet extData = invoice.DataExtRetList.GetAt(i);
            Console.WriteLine("external data name: " + extData.DataExtName.GetValue());
            Console.WriteLine("external data value: " + extData.DataExtValue.GetValue());
        }
    }
于 2015-11-11T19:04:32.100 に答える