How Run a Client Action When I close a screen/tab.
Application Type
Platform Version
11.11.0 (Build 27311)

I have the following script

this is to prompt the user when he tries to close a tab/screen.

What I want is, that when this prompt happens, the following client action should trigger.

All this does is save a text to the DB saying the user has closed his screen.


Hi Divan,

You can call a client action with Javascript using the $actions predefined object.

See here a step-by-step tutorial with screenshots on how to do it.

Kind Regards,


The risk with having a JS snippet for the same would also trigger when you leave a webpage i.e open a link or go to a new-tab or press browser-bank-button.

If that is something you are ok with, then I would recommend you to have that snippet in LayoutWB itself & then you can either invoke your custom popup from there itself. Having the snippet on LayoutWB will be applied to every Screen of your app.

Hope it helps,

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.