gpt4 book ai didi

quickbooks - QBFC Billadd GUID 错误

转载 作者:行者123 更新时间:2023-12-02 02:15:32 25 4
gpt4 key购买 nike

我是 C# 和 QBFC13 代码的新手,我正在尝试从 code I found on the intuit developer site under the BillAdd section 添加帐单.

BillAddRq.ExternalGUID.SetValue(Guid.NewGuid().ToString()); 抛出错误:

Invalid GUID format. Must use zero for Custom Fields, or a GUID generated with GuidGen.exe for private data extensions.

我已经尝试过:

String guid = System.Guid.NewGuid().ToString("B");
// MessageBox to see that it creates the number
MessageBox.Show("guid", guid);
BillAddRq.ExternalGUID.SetValue(guid);

BillAddRq.ExternalGUID.SetValue(Guid.NewGuid().ToString("B"));
And
String guid = System.Guid.NewGuid().ToString("0");

那些抛出:

QB Test 8-14-2014.vshost.exe - No Disk "There is no disk in the drive. Please insert a disk into drive F."

如何解决这些错误?

最佳答案

使用您的第一次字符串尝试是 GUID 的正确格式。我使用 GUID.NewGuid().ToString("B") 进行了测试,并能够获得在添加帐单时有效的 GUID

因为您收到有关驱动器中没有磁盘的错误,所以听起来好像是其他原因导致了该错误。我将单步执行代码并找到导致错误的确切位置,因为它可能与 GUID 无关。

这是我使用 QuickBooks 中的示例文件所做的一个简单示例:

QBSessionManager SessionManager = new QBSessionManager();
SessionManager.OpenConnection2("GUIDTest","GUIDTest", ENConnectionType.ctLocalQBD);
SessionManager.BeginSession("", ENOpenMode.omDontCare);

IMsgSetRequest MsgRequest = sessionManager.CreateMsgSetRequest("US", 13, 0);
MsgRequest.Attributes.OnError = ENRqOnError.roeContinue;

IBillAdd add = MsgRequest.AppendBillAddRq();
add.ExternalGUID.SetValue(System.Guid.NewGuid().ToString("B"));
add.VendorRef.FullName.SetValue("A Cheung Limited");
add.TxnDate.SetValue(DateTime.Today);
IExpenseLineAdd line = add.ExpenseLineAddList.Append();
line.AccountRef.FullName.SetValue("Travel & Lodging");
line.Amount.SetValue(100.00);

IResponse response = sessionManager.DoRequests(MsgRequest).ResponseList.GetAt(0);
MessageBox.Show(response.StatusMessage);

关于quickbooks - QBFC Billadd GUID 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25318098/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com