Web サービスを介して新しい販売注文を作成しています。ShipToAddress プロパティを、請求先住所とは異なる国にある国コードを持つ BusinessAddress クラスに設定しています。注文を作成して GP に送信すると、エラーはなく、GP が注文を受け取ります。しかし、注文を確認して発送先の国コードを確認すると、設定した国コードではなく、請求先または主要な住所の国コードを使用しているようです。
SalesOrder salesOrder = new SalesOrder();
salesOrder.ShipToAddress = ConfigureDropShipAdress(shipToCustomer);
private BusinessAddress ConfigureDropShipAdress(Customer dropShipCustomer)
{
var dropShipAddr = dropShipCustomer.Addresses.Where(a => a.Key.Id == "SHIP").FirstOrDefault();
BusinessAddress busAddr = new BusinessAddress
{
ContactPerson = dropShipAddr.ContactPerson,
Name = dropShipAddr.Name,
Line1 = dropShipAddr.Line1,
Line2 = dropShipAddr.Line2,
Line3 = dropShipAddr.Line3,
City = dropShipAddr.City,
State = dropShipAddr.State,
PostalCode = dropShipAddr.PostalCode,
CountryRegion = dropShipAddr.CountryRegion, //This puts Unites States for our dropship customer
CountryRegionCodeKey = dropShipAddr.CountryRegionCodeKey, // the code is correct at this point, but the country code is wrong in GP client... It is the original address's Ccode
Phone1 = dropShipAddr.Phone1,
Phone2 = dropShipAddr.Phone2,
Phone3 = dropShipAddr.Phone3,
Fax = dropShipAddr.Fax,
ExtensionData = code.ExtensionData,
Extensions = code.Extensions
};
return busAddr;
}
私は何を間違っていますか?設定している国コードを使用するための販売注文を取得するにはどうすればよいですか?