Looking for Page Leave event

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.

Using 2022.2.29. Thanks

1 Like

How about an event after RowChanged_SysPages (or RowChanging_SysPages)?

Condition expression: '{sysPages.epBinding}'.startsWith('RcvDtl')'

This is the type of event Epicor uses to check if you’re navigating “from” the landing page.

Not sure how version may impact this approach.

1 Like

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).

But was worth trying out. Thanks!

1 Like

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.

1 Like

Since my message is conditional to the state of my RcvHead, how will I access that view to know if I display or not?

1 Like

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.

1 Like

So that would require me to basically customize all screens. Not sure I like it, even if working. Thanks for assisting.

1 Like