Update delivery address of the existing order in BO

Hi,

I created a panel to edit organization information of the existing order in BO. Currently I am able to edit organization number, name, mobile phone number using something like:

order.CustomerInfo.SetOrganizationID(newOrganization.SystemId, SecurityToken.CurrentSecurityToken);

image

But I could not be able to edit delivery information (address1, address2, etc…)
image

Any idea how I can go through this?

Litium version: 7.7.9

you need to update the address on the delivery to change deliveryinformation

I tried using AddressCarrier but it didn’t work. This is how I did:

  var addressCarrier = new AddressCarrier();
                    addressCarrier.Address1 = newOrganization.Addresses[0]?.Address1;
                    addressCarrier.Address2 = newOrganization.Addresses[1]?.Address2;

                    foreach (var delivery in order.Deliveries)
                    {
                        var deliveryCarrier = delivery.GetAsCarrier(true);
                        deliveryCarrier.Address = addressCarrier;
                        delivery.SetValuesFromCarrier(deliveryCarrier, SecurityToken.CurrentSecurityToken);
                    }

I got this error:

Did you try to set the deliveryCarrier.Address.Address1 and Address2 instead of creating a new addressCarrier?

2 Likes

This one work fine.
Thank you all :slight_smile:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.