2017-09-14 28 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