Skip to main content
Solved

Processing Screen Projection DAC Help

  • March 4, 2026
  • 8 replies
  • 110 views

zherring
Jr Varsity III
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?

Best answer by zherring

The issue I faced ended up being a key field issue. Once I figured out which fields I actually needed to mark with “IsKey = true” then the data loaded in correctly to my grid and when using an attribute like this “[PXUnboundDefault(typeof(IsNull<lotSerialQtyAvail, locationQtyAvail>))]” on a PXQuantity field then everything defaulted correctly. I believe having incorrect key fields caused my data to not load as intended and then when pairing that with a default attribute it just would not work correctly.

8 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 III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 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 III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 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)
)]


 


zherring
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Answer
  • March 9, 2026

The issue I faced ended up being a key field issue. Once I figured out which fields I actually needed to mark with “IsKey = true” then the data loaded in correctly to my grid and when using an attribute like this “[PXUnboundDefault(typeof(IsNull<lotSerialQtyAvail, locationQtyAvail>))]” on a PXQuantity field then everything defaulted correctly. I believe having incorrect key fields caused my data to not load as intended and then when pairing that with a default attribute it just would not work correctly.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • March 9, 2026

Thank you for sharing your solution with the community ​@zherring!