需要QuickBooks QBFC13中的所有客户地址(具有唯一ID)



我有一个应用程序,它通过QBFC13连接到QuickBooks,下载客户(只有姓名、ID和其他一些详细信息(以及这些客户的所有已知地址。这一切似乎都很好,只是我看不到唯一标识地址的GUID或其他唯一标识符。例如,客户在QuickBooks中更改了地址,我需要知道应用程序中更改了哪个地址。或者,我使用地址ID而不是整个Addr1-5块将信息发送到QuickBooks。我原以为地址名是唯一的,但事实并非如此,不能为空。关闭addr字段既不实用也没有帮助。这个GUID存在吗?我是不是错过了一些简单的东西?有更好的方法吗?QB医生太残忍了!

VBA用于获取客户及其地址(为了清晰起见,对一些代码进行了删减(。

Dim respType As IResponseType
Set respType = curResp.Type
If (respType.getValue = rtCustomerQueryRs) Then
Dim custList As ICustomerRetList
Set custList = curResp.Detail
Dim curCust As ICustomerRet
Dim i As Integer
Dim insSQL As String
For i = 0 To custList.Count - 1
insSQL = "INSERT INTO " & CustomerTableName _
& "(CustomerID, QBEditSequence, Name, PhoneNumber, EMailAddress) " _
& "VALUES " _
& "("
Set curCust = custList.GetAt(i)
If (curCust.Sublevel.getValue = 0) Then
insSQL = insSQL & "'" & curCust.ListID.getValue & "',"
insSQL = insSQL & "'" & curCust.EditSequence.getValue & "',"
insSQL = insSQL & "'" & Replace(curCust.Name.getValue, "'", "''") & "',"
If (Not curCust.Phone Is Nothing) Then
insSQL = insSQL & "'" & curCust.Phone.getValue & "',"
Else
insSQL = insSQL & "'',"
End If
If (Not curCust.Email Is Nothing) Then
insSQL = insSQL & "'" & curCust.Email.getValue & "');"
Else
insSQL = insSQL & "'');"
End If
accessDB.Execute insSQL
' Add Bill to address
If Not curCust.BillAddressBlock Is Nothing Then
If curCust.BillAddressBlock.Addr1 Is Nothing = False Then
rs.AddNew
rs!CustomerID = curCust.ListID.getValue
rs!AddressType = "B"
rs!Addr1 = curCust.BillAddressBlock.Addr1.getValue
If curCust.BillAddressBlock.Addr2 Is Nothing = False Then rs!Addr2 = curCust.BillAddressBlock.Addr2.getValue
If curCust.BillAddressBlock.Addr3 Is Nothing = False Then rs!Addr3 = curCust.BillAddressBlock.Addr3.getValue
If curCust.BillAddressBlock.Addr4 Is Nothing = False Then rs!Addr4 = curCust.BillAddressBlock.Addr4.getValue
If curCust.BillAddressBlock.Addr5 Is Nothing = False Then rs!Addr5 = curCust.BillAddressBlock.Addr5.getValue
rs.Update
End If
End If
' Add Shipping Addresses
Dim shpList As IShipToAddressList
Set shpList = curCust.ShipToAddressList
If Not shpList Is Nothing Then
Dim s As Integer
For s = 0 To shpList.Count - 1
Dim saddr As IShipToAddress
Set saddr = shpList.GetAt(s)
rs.AddNew
rs!CustomerID = curCust.ListID.getValue
rs!AddressType = "S"
rs!AddressName = saddr.Name.getValue
rs!IsDefault = saddr.DefaultShipTo.getValue
rs!Addr1 = saddr.Addr1.getValue
If saddr.Addr2 Is Nothing = False Then rs!Addr2 = saddr.Addr2.getValue
If saddr.Addr3 Is Nothing = False Then rs!Addr3 = saddr.Addr3.getValue
If saddr.Addr4 Is Nothing = False Then rs!Addr4 = saddr.Addr4.getValue
If saddr.Addr5 Is Nothing = False Then rs!Addr5 = saddr.Addr5.getValue
rs.Update
Next s
End If
End If
Next i
End If
End If

几年前使用了qb,并回顾了那段时期的一些项目。请注意,这是由客户端内的qb报告编写器提取的,该编写器最有可能提供截断的记录。

没有预定义的全局唯一地址标识符作为特定地址的单个字段。客户/供应商名称对于其各自的账单发件人/收件人、发货发件人/收件人是唯一的,但账单地址可以与发货地址相同,其他公司也可以使用相同的地址。事实上,这在几种类型的企业中非常常见。

因此,bill from 1是供应商的唯一标题/名称,但地址字符串本身也可以出现在bill from 2、bill from 3到5中,然后再移动到bill from street、street 2、city、state、zip、country,所有这些字段加起来创建一个长地址字符串,简称bill from。

遗憾的是,我只有xlsxm和csv。不再可以访问qb,所以我无法深入查看,这实际上会提供有用的信息

最新更新