First, I’m not a developer by trade. However, I like challenges. Requirements: create three UDFs within Purchase Orders (Estimation Notes (text), Warehouse Last Review Date (date), and Warehouse Shipping Notes (text)). Two of these fields (the “Warehouse” fields) must be modifiable regardless of the state/status of the NORMAL type PO. The third field, Estimation Notes is only used during PO creation and not modified afterwards. All of these are needed within the Details Grid. One existing field, POLine.PromisedDate is needs to be modifiable as described for the other fields.
I created the three fields within the Details Grid. I then created an extension named mrROExtension in the workflow. I added the all of the UDFs to the workflow extension. I then created the Code graph managing the RowSelected base handler. After verification and compilation, no errors. Upon publishing to my local instance/tenant, all appears to work as desired.
I would greatly appreciate Community members reviewing the project and code and let me know if there is anything I should have done differently or that appears potentially concerning.
Code snippet:
namespace PX.Objects.PO
{
public class POOrderEntry_Extension : PXGraphExtension<PX.Objects.PO.POOrderEntry>
{
#region Event Handlers
protected void POLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseHandler)
{
baseHandler?.Invoke(cache, e);
var row = (POLine)e.Row;
PXUIFieldAttribute.SetEnabled<POLineExt.usrWHShipNotes>(cache, row, true);
PXUIFieldAttribute.SetEnabled<POLineExt.usrWHLastReviewDate>(cache, row, true);
PXUIFieldAttribute.SetEnabled<POLine.promisedDate>(cache, row, true);
}
#endregion
}
}
Attached the project export here as well.
Thanks in advance!!
Best answer by Naveen Boga
View original