Skip to main content
Question

Unable to Override Shipping Address When Creating Transfer Order from Appointment Action

  • March 10, 2026
  • 8 replies
  • 61 views

I am creating a Transfer Order in the Sales Order screen from an Action button on the Appointment screen.

After the Transfer Order is created, I need to override the Shipping Address (SOShippingAddress) with the address values from the Service Order Address.

However, the Shipping Address is not getting overridden, and the values are not updated in the Sales Order. Only overrdie check box is checked other fields not updating.

Below is the code I am currently using:

oGraph.Shipping_Address.Current = soGraph.Shipping_Address.Select();
soGraph.Shipping_Address.Current.IsDefaultAddress = true;
soGraph.Shipping_Address.Current.OverrideAddress = true;

soGraph.Shipping_Address.Current.AddressLine1 = Base.ServiceOrder_Address.Current.AddressLine1;
soGraph.Shipping_Address.Current.AddressLine2 = Base.ServiceOrder_Address.Current.AddressLine2;
soGraph.Shipping_Address.Current.City = Base.ServiceOrder_Address.Current.City;
soGraph.Shipping_Address.Current.State = Base.ServiceOrder_Address.Current.State;
soGraph.Shipping_Address.Current.CountryID = Base.ServiceOrder_Address.Current.CountryID;
soGraph.Shipping_Address.Current.PostalCode = Base.ServiceOrder_Address.Current.PostalCode;

soGraph.Shipping_Address.Cache.Update(soGraph.Shipping_Address.Current);

I also attempted using SetValueExt for the address fields and setting OverrideAddress = true, but still no luck

Could anyone please guide me on the correct way to override the Shipping Address when creating a Transfer Order programmatically from the Appointment screen?

8 replies

  • Freshman I
  • March 10, 2026

Hi,

When you override the address it creates a new SOShippingAdress, so you need first run the events, and get the updated address.
Please try this code.

 

SOShippingAddress shippingAddress = soGraph.Shipping_Address.Select();
  soGraph.Shipping_Address.Cache.SetValueExt<SOShippingAddress.overrideAddress>(shippingAddress, true);

shippingAddress = soGraph.Shipping_Address.Update(shippingAddress);

Then you can use your code to update the other fields.

 

Please let me know if this works!


  • Author
  • Freshman I
  • March 10, 2026

@saco86 Yes, I have already tried the same approach, but it did not work.
After setting OverrideAddress to true and calling Update(), I attempted to update the remaining address fields, but the values are still not getting updated


  • Freshman I
  • March 10, 2026

@vkumar68 Please add this code after the first update.

soGraph.Shipping_Address.Cache.SetValueExt<SOShippingAddress.revisionID>(shippingAddress, new int?(0));

This will allow you to change the values

 

Please let me know if this works!


  • Author
  • Freshman I
  • March 10, 2026

@saco86 Thanks for the response. Unfortunately, this did not work for me either.
Have you tested this on your side?


  • Freshman I
  • March 10, 2026

I developed a customization similar to your case. I will provide the full path—please review it, and it should work.

First, select the address. Then use SetValueExt to set OverrideAddress to true, update the record, and retrieve the updated one.

Next, assign the RevisionID using SetValueExt, and assign all other address fields using SetValueExt as well.

After that, add the following line:

shippingAddress.CustomerAddressID = shippingAddress.AddressID;

Then call Update again and retrieve the updated record.

Finally, in the order DAC, assign ShipAddressID to shippingAddress.AddressID.

I believe this line should be added, so the last part will look like this.

shippingAddress.CustomerAddressID = shippingAddress.AddressID;
shippingAddress = soGraph.Shipping_Address.Update(shippingAddress);
order.ShipAddressID = shippingAddress.AddressID;


If this does not work, please provide your code.
Also, let me know if shippingAddress becomes null after the first update.

 


Forum|alt.badge.img+1
  • Varsity I
  • March 10, 2026

Hello ​@vkumar68 ,

This option worked for me. Please try it.

SOShippingAddress shipAddress = docgraph.Shipping_Address.Current = docgraph.Shipping_Address.Select();

docgraph.Shipping_Address.SetValueExt<SOShippingAddress.overrideAddress>(docgraph.Shipping_Address.Current, true);

shipAddress = docgraph.Shipping_Address.Current;

shipAddress.AddressLine1 = order.ShipAddress1;
shipAddress.AddressLine2 = order.ShipAddress2;
shipAddress.City = order.ShipCity;
shipAddress.State = order.ShipState;
shipAddress.PostalCode = order.ShipZip;
shipAddress.CountryID = order.ShipCountryCD;

docgraph.Shipping_Address.Update(shipAddress);
docgraph.Actions.PressSave();

 


Forum|alt.badge.img+2
  • Pro III
  • March 10, 2026

@vkumar68 

I have faced similar issue earlier like this

The Shipping Address record is system-controlled, so the fields cannot be updated directly.
To override it properly, first enable Override Address and call Update() so the address record is initialized in the cache.

After that, reset RevisionID and update the required address fields. Calling Update() again ensures the changes are persisted and the record is not cleared or left null in the cache.

​As @saco86 mentioned finally, assign the updated AddressID back to the order’s ShipAddressID so the overridden address is linked correctly.

Use below code, Hope this helps!!

var cache = soGraph.Shipping_Address.Cache;

cache.SetValueExt<SOShippingAddress.overrideAddress>(soGraph.Shipping_Address.Current, true);
soGraph.Shipping_Address.Current = soGraph.Shipping_Address.Update(soGraph.Shipping_Address.Current);

if (soGraph.Shipping_Address.Current == null)
return;

cache.SetValueExt<SOShippingAddress.revisionID>(soGraph.Shipping_Address.Current, 0);

cache.SetValueExt<SOShippingAddress.addressLine1>(soGraph.Shipping_Address.Current, Base.ServiceOrder_Address.Current.AddressLine1);
cache.SetValueExt<SOShippingAddress.addressLine2>(soGraph.Shipping_Address.Current, Base.ServiceOrder_Address.Current.AddressLine2);
cache.SetValueExt<SOShippingAddress.city>(soGraph.Shipping_Address.Current, Base.ServiceOrder_Address.Current.City);
cache.SetValueExt<SOShippingAddress.state>(soGraph.Shipping_Address.Current, Base.ServiceOrder_Address.Current.State);
cache.SetValueExt<SOShippingAddress.countryID>(soGraph.Shipping_Address.Current, Base.ServiceOrder_Address.Current.CountryID);
cache.SetValueExt<SOShippingAddress.postalCode>(soGraph.Shipping_Address.Current, Base.ServiceOrder_Address.Current.PostalCode);

soGraph.Shipping_Address.Current = soGraph.Shipping_Address.Update(soGraph.Shipping_Address.Current);

soGraph.Shipping_Address.Current.CustomerAddressID = soGraph.Shipping_Address.Current.AddressID;
soGraph.Shipping_Address.Current = soGraph.Shipping_Address.Update(soGraph.Shipping_Address.Current);

 


  • Author
  • Freshman I
  • March 10, 2026

@saco86  ​@SaiKrishnaV ​@Vard86 Thank you for your response. I will work on the above suggestions and let you know.