Skip to main content
Question

How to add on hand qty to Job item requisition

  • January 20, 2026
  • 2 replies
  • 51 views

Kandy Beatty
Captain II
Forum|alt.badge.img+18

Hi all,

I’ve been trying to find a way to add the On Hand qty of an inventory item on the Job Item Requistion screen and it’s not pulling the qty. I also thought of doing a side panel of on hand qty. What is the best way to handle it? I know that it is a virtual calculation in the background. 

 

 

2 replies

Forum|alt.badge.img

@Kandy Beatty if you are using the User Defined Field then you can write PXDefault in you DAC Field as below.

[PXDefault(typeof(Search<INSiteStatus.qtyOnHand, 
    Where<INSiteStatus.inventoryID, Equal<Current<YourDAC.inventoryID>>,
    And<INSiteStatus.siteID, Equal<Current<YourDAC.siteID>>>>>), 
    PersistingCheck = PXPersistingCheck.Nothing)]


Forum|alt.badge.img

Hi ​@Kandy Beatty,

You can try the following approach:
1. Add an unbound DAC field :

[PXDecimal]
[PXUIField(DisplayName = "On Hand Qty", Enabled = false)]
public decimal? UsrOnHandQty { get; set; }
public abstract class usrOnHandQty : PX.Data.BQL.BqlDecimal.Field<usrOnHandQty> { }

 

2. Populate the field in the Graph using event :

protected void _(Events.RowSelecting<PMJobItemReq> e)
{
    UpdateAvailability(e.Row as PMJobItemReq);
}


protected void _(Events.FieldUpdated<PMJobItemReq.inventoryID> e)
{
    UpdateAvailability(e.Row as PMJobItemReq);
}

protected void _(Events.FieldUpdated<PMJobItemReq.siteID> e)
{
    UpdateAvailability(e.Row as PMJobItemReq);
}

private void UpdateAvailability(PMJobItemReq row)
{
    if (row == null) return;

    var ext = row.GetExtension<PMJobItemReqExt>();

    if (row.InventoryID != null && row.SiteID != null)
    {
        var status = INAvailabilityFetch.FetchSite(
            Base,
            row.InventoryID,
            row.SiteID,
            false
        );
        ext.UsrOnHandQty = status?.QtyOnHand;
    }
    else
    {
        ext.UsrOnHandQty = null;
    }