I am currently working on an Epicor 10.1 “Customization” and I’m having trouble setting a custom date field value on a purchase order line item’s release (PORel). Essentially, when I modify a custom date value on the purchase order header (POHeader), or on the line item (PODetail), I’d like to copy the date value over to the release (PORel).
Scenario #1 - When the purchase order header (POHeader) custom date changes, cascade the change to all line items (PODetail) and releases (PORel)
I’ve been able to solve this scenario using the following approach:
- Add logic to the "POHeader_AfterFieldChange" event to listen for the custom date field change
- On change, loop through each qualifying row in the EpiDataView for releases (PORel) and set the custom date field
- Use the oTrans.Update() method to save the release changes otherwise upcoming changes to the PO line items will wipe them out
- Next, loop through the qualifying PO line items (PODetail) and set the custom date field
- Call oTrans.Update() again to save the line item changes
I’m not convinced that this is the correct solution or efficient for that matter, but it is semi-functional at the moment.
Scenario #2 - When a line item (PODetail) custom date changes, cascade the change to the related releases (PORel)
For this scenario, I’ve tried countless approaches without much success. It appears that there is a relationship between the PODetail and PORel EpiDataViews, along with internal Epicor events, causing the purchase order release row to be re-initialized when the parent line item is changed. I am currently able to set the custom date value on the release and see it presented on the UI, but the “save” button or oTrans.Update() causes the value to reset as if it is not committed to the database. A quick list of the methods I’ve tried in various ways can be found below:
- ["RowMod"] = "U"
Does anyone happen to have a working code snippet for altering a field value on a purchase order line item release? If using a BPM instead of a Customization is recommended, feel free to comment as well. I will gladly post some of my current logic if needed, but I’d rather not have non-functioning code as the initial focal point. Thank you for any input and advice!