私は、クイックブックデスクトップ(エンタープライズ版)からクレジットメモをプログラマチックに/ c#コードで取得する必要があります。クイックブックデスクトップからのクレジットメモをC#コードで回収する
誰もこのコード/メソッドを使用して私を助けることができます。あなたはCreditMemoQueryを使用する必要があります
おかげ
私は、クイックブックデスクトップ(エンタープライズ版)からクレジットメモをプログラマチックに/ c#コードで取得する必要があります。クイックブックデスクトップからのクレジットメモをC#コードで回収する
誰もこのコード/メソッドを使用して私を助けることができます。あなたはCreditMemoQueryを使用する必要があります
おかげ
。
オンスクリーンリファレンスガイド - http://developer-static.intuit.com/qbsdk-current/common/newosr/index.htmlを参照するか、その他のリクエストのサンプルを見て変更してください。
https://developer.intuit.com/docs/0250_qb/0050_documentation/sample_code
使用ICreditMemoQuery
のQuickBooksからクレジットメモのリストを取得するためのオブジェクト。 QuickBooks SDK 13.0を使用してクレジットメモのリストを取得するサンプルC#コードは次のとおりです。
using QBXMLRP2Lib;
using Interop.QBFC13;
public class SDKApp
{
private QBSessionManager sessionMgr;
public SDKApp()
{
// in the class constructor - sessionMgr is a member variable
sessionMgr = new QBSessionManager();
}
public void GetCreditMemoData()
{
// open connection and begin session before data fetch - intentionally skipped this code
IMsgSetRequest msgset = null;
ICreditMemoQuery creditMemoQuery = null;
try
{
// during data fetch
msgset = sessionMgr.CreateMsgSetRequest("US", 13, 0);
creditMemoQuery = msgset.AppendCreditMemoQueryRq();
creditMemoQuery.ORTxnQuery.TxnFilter.ORDateRangeFilter.ModifiedDateRangeFilter.FromModifiedDate.SetValue(new DateTime(2012, 3, 31), false); // you can apply filters too
IMsgSetResponse msgRes = sessionMgr.DoRequests(msgset);
IResponseList responseList = msgRes.ResponseList;
if (responseList.Count > 0)
{
IResponse response = responseList.GetAt(0);
ICreditMemoRetList creditMemoList = response.Detail as ICreditMemoRetList;
if (creditMemoList == null)
{
return;
}
for (int i = 0; i <= creditMemoList.Count - 1; i++)
{
ICreditMemoRet qbCreditMemo = creditMemoList.GetAt(i);
Console.WriteLine("Credit no.:" + qbCreditMemo.TxnNumber.GetValue() + " Customer:" + qbCreditMemo.CustomerRef.FullName.GetValue() + " Total:" + qbCreditMemo.TotalAmount.GetValue());
}
}
}
catch (Exception ex)
{
//handle exception here
}
finally
{
if (msgset != null)
{
Marshal.FinalReleaseComObject(msgset);
}
if (creditMemoQuery != null)
{
Marshal.FinalReleaseComObject(creditMemoQuery);
}
}
// end session and close connection after data fetch - intentionally skipped this code
}
}
希望します。
私は上記の方法を使用しましたが、私はQuickbooksからすべてのクレジットメモを取得したいだけです。私はquickbooksの統合に慣れてきたので、私がCreditMemoQuery()を理解することは困難でした。あなたがQBからクレジットメモだけを取り出すための関連コードを手伝ってくれれば幸いです。 – Shyam