I have a customization which updates a custom date field when another custom field (called UsrAIWHLPrice) is updated. This has been working fine since 2022. Since upgrading to 2023R2 the field doesn’t update any longer.
The code is below:
protected void InventoryItem_UsrAIWHLPrice_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e, PXFieldUpdated InvokeBaseHandler)
{
if(InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (InventoryItem)e.Row;
if (row == null) return;
try{
InventoryItemExt invItemExt = PXCache<InventoryItem>.GetExtension<InventoryItemExt>(row);
if (invItemExt.UsrAIWHLPriceChangeDate != null) {
invItemExt.UsrAIWHLPrevPriceChangeDate = invItemExt.UsrAIWHLPriceChangeDate;
}
invItemExt.UsrAIWHLPriceChangeDate = PX.Common.PXTimeZoneInfo.Now;
}
catch (Exception error) {
PXTrace.WriteInformation("error: " + error);
}
}
There is no error in trace so I suspect it is because I haven’t used the correct method to update the field in the extension. I think I should be updating the cache instead but I’m not sure how to do that.
Can anyone advise where I’m going wrong?
Thanks,
Phil
Best answer by darylbowman
View original