Skip to content

Instantly share code, notes, and snippets.

@kulvirTAC
Created December 11, 2022 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kulvirTAC/4c9b9268bb565b277713731489878e5e to your computer and use it in GitHub Desktop.
Save kulvirTAC/4c9b9268bb565b277713731489878e5e to your computer and use it in GitHub Desktop.
Acumatica Example
//Update price and repair item type when inventory ID of repair item
//is updated.
protected void _(Events.FieldUpdated<RSSVRepairItem,
RSSVRepairItem.inventoryID> e)
{
RSSVRepairItem row = e.Row;
if (row.InventoryID != null && row.RepairItemType == null)
{
//Use the PXSelector attribute to select the stock item.
InventoryItem item = PXSelectorAttribute.
Select<RSSVRepairItem.inventoryID>(e.Cache, row)
as InventoryItem;
//Copy the repair item type from the stock item to the row.
InventoryItemExt itemExt = item.GetExtension<InventoryItemExt>();
e.Cache.SetValueExt<RSSVRepairItem.repairItemType>(
row, itemExt.UsrRepairItemType);
}
//Trigger the FieldDefaulting event handler for basePrice.
e.Cache.SetDefaultExt<RSSVRepairItem.basePrice>(e.Row);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment