We have some custom fields on the Order Entry screens used for tracking purposes related to specific lines. The issue is that a lot of the time these order lines are copied (copy selection) from the “list” view under “lines” and then pasted (paste insert), the data in the tracking fields is still present.
We currently have a data directive BPM to clear these fields when the entire order is copied using “actions” “copy order” and that works fine.
I’ve ran a trace on the “copy” “paste” method (pictured below). and I’ve tried a post-directive on “GetNewOrderIDtl” but it doesn’t seem to have access to the data of the new line being created when it fires. I used a message box to see if it would return the new order line and the data in the custom field, and it was not working.
The GetNew[tablename] methods are run Before any data from the UI is set. The purpose is to return an empty record populated with the Default values - as specified in the Epicor code or by the Extended Properties.
Paste Update is really a UI Framework function that updates the underlying data row so that any of the OnChanging and OnChanged events fire. You should be able to catch the change in UI customization using one of those methods.
A BPM will not know how the row was created, only the methods that were called. In this case, you would need a Customization to clear the UD fields if the user used Paste/Insert (or Paste/Update if they’ve already clicked “New”). However, I’m not 100% sure how to know when the data is being populated that it is from a Paste operation…
A data directive should work. Just set all the fields to empty strings to added rows. This is assuming this data is always entered some time after the initial save.