I want to add the “Last Vendor Price” that is shown in the Stock Items screen to the data grid on the “Purchase Orders” screen.
I believe this will involve creating a custom non-DB related field in the PX.Objects.PO.POLine DAC. Then I would get the value from the POVendorInventory table for the respective vendor in the Purchase Orders screen.
I think I would do this in an POOrderEntry_Extension : PXGraphExtension<POOrderEntry> extension as that is the graph used for the Purchase Orders screen.
I would get the value to store in the custom field and trigger it with one of the row events. However, I’m not sure which one to use. Can someone give me advice on which one of these is the most appropriate?
Thank you in advance for your help. Also, if you think my plan is bad, I’d welcome any suggestions.
@joe21 Just create a BQL to the “POVendorInventory” table to fetch the Last Vendor Price for the Purchase Order Vendor and assign it to the newly created field at POLine.
I’ve never used InvokeBaseHandler?.Invoke(cache, e); Where would I ever learn about that? That command was not part of the training series. Is there another training series that would teach me about things like that?
Also, in your PXSelect, you have this: row?.InventoryID What is the reason for the “?” after row?
Here are my suggestions, please find the details below.
Since you wanted to go with the unbound field, you have the logic in the “POLine_UsrLastVendorPrice_FieldSelecting” instead of RowSelected event (No BQL’s allowed to write in this event)
When we are writing the event for default Acumatica fields, first we should invoke the Base logic, then our logic should be executed. → To invoke the Base logic code we should use this code → InvokeBaseHandler?.Invoke(cache, e);
“?”, this is C# concept i.e. Nullalble type. I always use like this to avoid the Object/Null reference issues.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.