Hello, I’m struggling with the FieldUpdated event.
On the Project Quotes form (PM304500) you enter Inventory IDs on the Estimation tab. When you commit an Inventory ID on a grid row, the description, uom and unit price are returned. Very similar to entering products onto a sales or purchase order. I would like to ignore the default price returned and update the field with my own value.
The screen shot above shows that when SOFTLIC was entered the unit price was defaulted to 666.00
I’ve tried using the following (heavily cut back) code to update the unit price field but it’s not working, 22 doesn’t appear in the field:
protected void CROpportunityProducts_InventoryID_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
var row = (CROpportunityProducts)e.Row;
string val = "22";
cache.SetValueExt<CROpportunityProducts.curyUnitPrice>(row, val);
}
I’m pretty certain that there is another event in the Acumatica code which is firing after my event. This makes sense since I can see that the description, uom and price fields are appearing.
I wondered if there was a way to ensure my event fires last, or is there a way to find and extend the Acuamtica method which is populating the unit price? Or any other ideas on how I can achieve this requirement.
Thanks
Best answer by Django
View original