Created
December 11, 2022 22:22
-
-
Save kulvirTAC/4c9b9268bb565b277713731489878e5e to your computer and use it in GitHub Desktop.
Acumatica Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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