I have a created a custom field which I want to use to track when the item sales categories have changed. See image below:

I added code to field verifying:
protected void INItemCategory_CategoryID_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e, PXFieldVerifying InvokeBaseHandler)
{
if(InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (INItemCategory)e.Row;
if (row == null) return;
PXTrace.WriteInformation("Set BC Updated");
// Update the BC Updated field to false
try {
InventoryItem inventoryItem = PXSelect<
InventoryItem,
Where<InventoryItem.inventoryID, Equal<Required<InventoryItem.inventoryID>>
>>.Select(Base, ((PX.Objects.IN.INItemCategory)cache.Current).InventoryID);
if (inventoryItem != null) {
PXTrace.WriteInformation("InventoryItem found" + inventoryItem.InventoryID);
}
InventoryItemExt invItemExt = PXCache<InventoryItem>.GetExtension<InventoryItemExt>(inventoryItem);
invItemExt.UsrAIBCCatAdded = false;
PXTrace.WriteInformation("Updated");
}
catch (Exception error) {
PXTrace.WriteInformation("Error: " + error);
}
}
I’m probably doing this completely incorrectly. I think my main problem is I don’t know how to get the actual custom field on the screen to update (in the cache I guess).
Any help would be much appreciated.
Thanks in advance,
Phil