Skip to main content
Question

How can I properly update an unbound field on the header when selecting a line item from the details?

  • February 9, 2026
  • 2 replies
  • 27 views

Forum|alt.badge.img

Hello Community, 

I am working on a small customization to simply pull up the Stock Items screen in a side panel when changing the detail row. It seemed like I couldn’t accomplish this on the POLine level and only choose header fields when adding the side panel, so I went with an unbound field on POOrder. How can I make it when changing the detail selection to successfully update the unbound field “Selected Item” below? You’ll notice I have the side panel popped up and open to the PNF item, but I have the EMP item selected. Any ideas? I did try forcing a “Note” update on change to refresh UI, but no luck. It does update by changing the side panel to something else and then back to stock item. See below for my code and screenshot:

        #region UsrReadInventoryNbr
[PXString(60)]
[PXUIField(DisplayName = "Selected Item", Enabled = false)]
public string UsrReadInventoryNbr { get; set; }
public abstract class usrReadInventoryNbr : PX.Data.BQL.BqlString.Field<usrReadInventoryNbr> { }
#endregion
       protected virtual void _(Events.RowSelected<POLine> e)
{
var line = (POLine)e.Row;
if (line == null || line.InventoryID == null) return;

// Fetch InventoryItem record using InventoryID
InventoryItem item = SelectFrom<InventoryItem>
.Where<InventoryItem.inventoryID.IsEqual<@P.AsInt>>
.View.ReadOnly.Select(Base, line.InventoryID);

if (item == null) return;

// Set InventoryCD to the unbound string field on the parent
POOrder order = Base.Document.Current;
if (order == null) return;

POOrderExt orderExt = PXCache<POOrder>.GetExtension<POOrderExt>(order);
orderExt.UsrReadInventoryNbr = item.InventoryCD;

Base.Document.Cache.SetValueExt<POOrderExt.usrReadInventoryNbr>(order, item.InventoryCD);
//Base.Document.Cache.SetStatus(order, PXEntryStatus.Updated);
Base.Document.Cache.SetValueExt<POOrder.noteID>(order, order.NoteID);
}
protected void POLine_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
var line = (POLine)e.Row;
if (line?.InventoryID == null) return;

InventoryItem item = SelectFrom<InventoryItem>
.Where<InventoryItem.inventoryID.IsEqual<@P.AsInt>>
.View.ReadOnly.Select(Base, line.InventoryID);

if (item == null) return;

var order = Base.Document.Current;
if (order == null) return;

var orderCache = Base.Document.Cache;
var orderExt = orderCache.GetExtension<POOrderExt>(order);

string newInventoryCD = item.InventoryCD;

if (orderExt.UsrReadInventoryNbr != newInventoryCD)
{
// Update the unbound field
orderExt.UsrReadInventoryNbr = newInventoryCD;
Base.Document.Cache.SetValueExt<POOrder.noteID>(order, order.NoteID);
// Force UI to recognize the change
orderCache.RaiseFieldUpdated<POOrderExt.usrReadInventoryNbr>(order, null);
orderCache.RaiseFieldUpdated<POOrder.noteID>(order, null);
orderCache.SetStatus(order, PXEntryStatus.Updated);
}
}

Thanks,

Adam

2 replies

Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi ​@AJohnson,

You can try using PXRedirectRequiredException to open the same screen again in the same tab. This should force the screen to refersh.

For more details on it, kindly refer, https://help.acumatica.com/(W(1))/Help?ScreenId=ShowWiki&pageid=13d4a907-f13d-9307-00b1-2db76ee9c6ba


arpine08
Jr Varsity I
Forum|alt.badge.img
  • Jr Varsity I
  • February 9, 2026

Hi  AJohnson,

I found a few related cases that describe similar issues and approaches: