I’m trying to display a message to users when they leave the Receipt Entry Detail page (based on some RcvHead condition) but cannot find the right event on when to fire, if there’s any.
Before_ClearUI event works for when hitting Clear menu or when going back to the Receipt Entry landing page (using the breadcrumb navigator on top left). It however doesn’t fire when we click on left-side navigation pane (ex: Home button, or opening a new menu) or when using the Search menu (… → Search) to open another receipt.
I tried both Changed/Changing and also Before/After, but none seems to trigger when navigating outside Receipt Entry using the left pane, nor using the Search. Seems to work only when switching from landing Page to Detail (or vice-versa).
I’ve not tried to do something like this, but I can think of a way to make it work with a sledgehammer,
If you put an oncreate event on some widget of each page, you can do your stuff in that event (so rather than hooking into the page leave of the page you left, hook into the page load of the page you’re going to)
Since there are multiple exit points to a page, but any of them are going to result in loading a new page.
Generally speaking, Epicor doesn’t clear a DataView when switching pages (sometimes they do) - likely your data is still there in RcvHead no matter what page you are on, so in the event add a condition to check for your state, and fire the message if true.