将代码放在RowUpdated事件下,这应该对您有用。
protected void InventoryItem_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e, PXRowUpdated InvokeBaseHandler)
{
if (InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (InventoryItem)e.Row;
Combined.StockItem.InventoryItemExt rowExt = PXCache<InventoryItem>.GetExtension<Combined.StockItem.InventoryItemExt>(row);
if (row == null) return;
if (row != null) {
string style = row.ItemClassID;
string metalColor = rowExt.UsrMetalColor;
string metalType = rowExt.UsrMetalType;
string diaQuality = rowExt.UsrDiamondQuality;
string gemColor = rowExt.UsrCenterColor;
string template = "{0}-{1}-{2}-{3}-{4}";
string message = string.Format(template, style, metalColor, metalType, diaQuality, gemColor);
PXTrace.WriteInformation("{0}", message);
cache.SetValueExt<InventoryItem.descr>(row, message);
}
}