I am trying to run some code whenever the qtyAvail changes for a stock item. I have added code in an extension to InventoryItemMaint to both INSiteStatus and INSiteStatusSummary for the event fieldupdated for the field qtyAvail, but I cannot get my code to execute.
Any suggestions about the right way to capture that field change?
public class InventoryItemMaint_Extension : PXGraphExtension<InventoryItemMaint>
void _(Events.FieldUpdated<INSiteStatusSummary, INSiteStatusSummary.qtyAvail> e){
//My Code
}
void _(Events.FieldUpdated<INSiteStatus, INSiteStatus.qtyAvail> e){
//My Code
}
You don't explain in your ticket when qtyAvail will change which is a key element to your problem. Going out on a limb, I'm going to assume you are thinking of this like a Database trigger that fires whenever the value changes, but that is not the case. Events are driven by actions taken by one of a graph's (InventoryItemMaint) caches. I don't think there is any operation in Inventory Item Maintenance that changes the qtyAvail for either of these DACs, therefore the qtyavail field will not be updated in a cache for this graph and the event you've created won't fire.