Intercept and modify the first OrderMsc grid row in an OrderHed

Hello folks, I’m finding the docs confusing. Trying to use AfterRowChange to detect when a user has set the MiscCode on a new order header miscCharge.

The docs and many folks on here point out:

" This event handler does not run if a new row has been added to the grid. It also does not run if only one row is present on the grid. In this case, this event needs to listen for a ListChanged event handler to activate first – then the AfterRowChange event handler runs. "

And the docs for ListChanged, unfortunately, only say:

“This event handler is called after data within a list has been changed. It can only be used if the list contains one row of data. Depending on the UI, it must also be used in combination with either the AfterRowChanged() event handler or the AfterGetByID() method.”

And I’m not getting it. Either handler compiles and an already-saved misc charge can trigger this; but what we need is to have the amount updated based on criteria. We already do this with freight charges based on clicking a button, and maybe that’s what I’ll have to create, but I’m trying to make this not require further customization when we go to Kinetic.

Does anyone know the technique needed to act on the selection of a drop-down in a grid row when the row is either new or the only row, or both?

You could try using the EpiViewNotification event, though it’s a bit of a firehose, so give it a good test or 5.

feels game of thrones GIF

Yes, been fiddling with this to no avail, but will continue and post code if I can or cannot do anything with it.

Is there a reason you need this in the UI vs using a pre-processing BPM?

Well, its purpose is to modify the OrderMscRow amount based on criteria before saving the record, and I wanted to avoid reloading the order. But it’s entirely possible my ignorance is showing…

Update the amount using a preprocessing, then use a post directive to auto refresh the screen.

dsHolder code example – modify to your needs for the order.