Skip to main content
Question

Processing Screen Projection DAC Help

  • March 4, 2026
  • 6 replies
  • 75 views

zherring
Jr Varsity II
Forum|alt.badge.img

I am working on a processing screen. The grid of this screen works off of a projection DAC that joins a bunch of inventory tables (INLocationStatusByCostCenter, InventoryItem, INSite, INLocation, INItemSite, and INLotSerialStatusByCostCenter). I am trying to surface the QtyAvail field. I have the respective fields in the DAC:

#region LocationQtyAvail
[PXDBQuantity(BqlField = typeof(INLocationStatusByCostCenter.qtyAvail))]
[PXUIField(Enabled = false)]
public decimal? LocationQtyAvail { get; set; }
public abstract class locationQtyAvail : BqlDecimal.Field<locationQtyAvail> { }
#endregion

#region LotSerialQtyAvail
[PXDBQuantity(BqlField = typeof(INLotSerialStatusByCostCenter.qtyAvail))]
[PXUIField(Enabled = false)]
public decimal? LotSerialQtyAvail { get; set; }
public abstract class lotSerialQtyAvail : BqlDecimal.Field<lotSerialQtyAvail> { }
#endregion

My goal is to have one general QtyAvail field that has logic that determines which actual QtyAvail to use. If the lot serial QtyAvail is null then use the location QtyAvail. That way in my view delegate (that populates my grid) can just hold the general conditions of for example "QtyAvail is greater than zero" and we can filter for a specific site/location.I have tried using all of the following at different times but nothing seems to actually populate the field in order to have a bql condition performed. 

[PXDBQuantity(BqlField = typeof(IsNull<INLotSerialStatusByCostCenter.qtyAvail, INLocationStatusByCostCenter.qtyAvail>))]

[PXDBQuantity(BqlField = typeof(Coalesce<SearchFor<INLotSerialStatusByCostCenter.qtyAvail>, SearchFor<INLocationStatusByCostCenter.qtyAvail>>))]

[PXFormula(typeof(
  Switch<
    Case<Where<lotSerialQtyAvail.IsNull>, locationQtyAvail>,
    lotSerialQtyAvail
  >
))]

What is the best way to do this while keeping this logic contained in the projection DAC?

6 replies

anahizentella94
Jr Varsity III
Forum|alt.badge.img

Have you tried with this formula?

[PXFormula(typeof(IsNull<INLotSerialStatusByCostCenter.qtyAvail, INLocationStatusByCostCenter.qtyAvail>))]

 


zherring
Jr Varsity II
Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • March 5, 2026

@anahizentella94 
I have tried that as well. I believe the problem here is more than just having the correct formula. This is more about how events and attributes get called when using a projection DAC mixed with a processing screen graph. Since the view delegate is loading in data ‘differently’ than how a regular graph gets data, the events that get called are different as well it seems.


anahizentella94
Jr Varsity III
Forum|alt.badge.img

Maybe, if you share your projection we can review for details?


zherring
Jr Varsity II
Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • March 5, 2026

@anahizentella94 
I fixed the issue, thank you though!


anahizentella94
Jr Varsity III
Forum|alt.badge.img

Can you share your findings? Maybe this can help someone else

 


Have you tried using PXDBScalar? This will work the switch statement directly into the SQL select. The field itself would be marked as unbound, but would receive its result.

[PXQuantity]
[PXDBCalced
(
typeof(Switch<Case<Where<INlotSerialStatusByCostCenter.qtyAvail, IsNull>, INLocationStatusByCostCenter.qtyAvail>, INlotSerialStatusByCostCenter.qtyAvail>),
typeof(decimal)
)]