2017-09-14 141 views
0

我無法在填寫了完整的運輸和帳單地址的Quickbooks Online發票沙箱帳戶中獲取客戶數據,主要是State和ZipCode。以下任何「行」屬性是否對應於Zip或State字段?我無法讓這些填充到我的沙箱中。Intuit QuickBooks集成(C#.NET/SDK) - 哪個PhysicalAddress屬性用於ZipCode和狀態字段?

Screenshot

var billaddr = addressRepository.Get(a => a.ContactMethodID == contactMethod.ContactMethodID && a.AddressTypeId == 2).First(); 
       var shipaddr = addressRepository.Get(a => a.ContactMethodID == contactMethod.ContactMethodID && a.AddressTypeId == 3).First(); 
       newCustomer.BillAddr = new PhysicalAddress() { City = billaddr.City, Line1 = billaddr.Address1, Line2 = billaddr.Address2, PostalCode = billaddr.ZipCode, Country = billaddr.Country, Line3 = billaddr.State, Line4 = billaddr.ZipCode }; 
       newCustomer.ShipAddr = new PhysicalAddress() { City = shipaddr.City, Line1 = shipaddr.Address1, Line2 = shipaddr.Address2, PostalCode = shipaddr.ZipCode, Country = shipaddr.Country, Line3 = shipaddr.State, Line4 = shipaddr.ZipCode }; 

https://developer-static.intuit.com/SDKDocs/QBV3Doc/IPPDotNetDevKitV3/html/3cbe37d6-2d4b-6811-fc81-54fe04ba2c3e.htm

Public property Line1 
    Product: QBW Description: First line of the address.[br /]Max. length: 41 characters. Product: QBO Description: First line of the address.[br /]Max. length: 500 characters. 
    Public property Line2 
    Product: QBW Description: Second line of the address.[br /]Max. length: 41 characters. Product: QBO Description: Second line of the address.[br /]Max. length: 500 characters. 
    Public property Line3 
    Product: QBW Description: Third line of the address.[br /]Max. length: 41 characters. Product: QBO Description: Third line of the address.[br /]Max. length: 500 characters. 
    Public property Line4 
    Product: QBW Description: Fourth line of the address.[br /]Max. length: 41 characters. Product: QBO Description: Fourth line of the address.[br /]Max. length: 500 characters. 
    Public property Line5 
    Product: QBW Description: Fifth line of the address.[br /]Max. length: 41 characters. Product: QBO Description: Fifth line of the address.[br /]Max. length: 500 characters. 

回答

1

每您提供給Intuit的文檔的鏈接,它看起來像國家和Zip封裝在CountrySubDivisionCode和PhysicalAddress類,分別爲POSTALCODE屬性:

CountrySubDivisionCode 
Product: QBW 
Description: Region within a country. For example, state name for USA, province name for Canada. 
Max. length: 21 characters. 
Product: QBO 
Description: Globalized representation of a region. For example, state name for USA, province name for Canada. 
Max. length: 255 characters. 

PostalCode 
Product: QBW 
Description: Postal code. 
For example, zip code for USA and Canada. 
Max. length: 13 characters. 
Product: QBO 
Description: Postal code. 
For example, zip code for USA and Canada. 
Max. length: 30 characters. 

我看到你已經試過PostalCode;你試圖分配給這個屬性的數據有哪些例子?

+0

謝謝你的迴應! Zip Example - 9000,State - CA – Vahe

+0

@Vahe對不起,我昨天沒有時間回覆。我查看了ILSPY中的DLL以查看PostalCode屬性中是否有一些驗證(可能需要5個字符作爲示例),但沒有找到任何驗證,所以我不確定它爲什麼不出現。你是否能夠使用CountrySubDivisionCode屬性來填充狀態? –

+0

不用擔心,我在我的例子中犯了一個錯誤,例如狀態應該是90000。最少5個字符。 – Vahe

相關問題