Dynamics GP Webservices CountryRegionCodeKey

时间:2016-10-17 18:36:47

标签: c# web-services microsoft-dynamics gp

我正在通过网络服务创建新的销售订单。 我将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;
    }

我做错了什么?如何获取销售订单以使用我正在设置的国家/地区代码?

0 个答案:

没有答案
相关问题