My customer asked me to show the Shipping Address Line 1 and line 2 in a new 4th column in the header of the Sales Order screen.
I created two unbound string fields to store the values from the Addresses tab (shipping address info).
Even using the “nuclear” option of the SOOrder RowSelected handler, the values will not show in the custom fields.
In debug, I can see the values being set correctly in the custom fields, but when the screen displays, they are empty.
I don’t think it is possible to do this using PXUnbound in the DAC extension because I need the custom fields to be updated if the user overrides the address lines in the Addresses tab.
I tried to do the update after the RowSelected handler has been invoked, but that didn’t make any difference.
Here is my DAC:
public sealed class GTSOOrderExt : PXCacheExtension<PX.Objects.SO.SOOrder>
{
public static bool IsActive() => true;
#region UsrShipAddressLine1
[PXString(50)]
[PXUIField(DisplayName = "Ship Address Line 1", Enabled = false)]
public string UsrShipAddressLine1 { get; set; }
public abstract class usrShipAddressLine1 : PX.Data.BQL.BqlString.Field<usrShipAddressLine1> { }
#endregion
#region UsrShipAddressLine2
[PXString(50)]
[PXUIField(DisplayName = "Ship Address Line 2", Enabled = false)]
public string UsrShipAddressLine2 { get; set; }
public abstract class usrShipAddressLine2 : PX.Data.BQL.BqlString.Field<usrShipAddressLine2> { }
#endregion
}Here is my graph extension:
protected void SOOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
if (InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (SOOrder)e.Row;
if (row == null) return;
PXUIFieldAttribute.SetEnabled<GTSOOrderExt.usrShipAddressLine1>(cache, row, false);
PXUIFieldAttribute.SetEnabled<GTSOOrderExt.usrShipAddressLine2>(cache, row, false);
GTSOOrderExt ext = row.GetExtension<GTSOOrderExt>();
if (ext != null)
{
SOShippingAddress shipAddress = Base.Shipping_Address.Current;
if (shipAddress != null)
{
ext.UsrShipAddressLine1 = shipAddress.AddressLine1;
ext.UsrShipAddressLine2 = shipAddress.AddressLine2;
cache.SetValue<GTSOOrderExt.usrShipAddressLine1>(row, shipAddress.AddressLine1);
cache.SetValue<GTSOOrderExt.usrShipAddressLine2>(row, shipAddress.AddressLine2);
}
}
}
Any ideas?
I thought I’d knock this one out in 15 minutes.

