Global OnBeforeNavigate Client Action
204
Views
4
Comments
New
Service Studio

OutSystems Reactive Web Apps that allows developers to define a global Client Action  "Global OnBeforeNavigate"  (or Server Action) that executes before navigation to any screen. 

(In Reactive - At least On before request of  server & Service action, allows to add custom logic validation, Authentication, etc)

This acts as a centralized "middleware" or "router hook" similar to ASP.NET Core Middleware 

Currently, OutSystems developers must manually call shared actions in OnInitialize of each screen — which is error-prone, repetitive, and unscalable in large apps.

Adding global lifecycle hooks brings enterprise-grade control and flexibility to navigation handling — making Reactive Web development cleaner and more maintainable.

Absolutely agree — this is a much-needed enhancement in OutSystems Reactive Web Apps. Introducing a global OnBeforeNavigate Client action would significantly improve app architecture by reducing repetitive code and enabling centralized control over authentication, validation, or even feature toggles. 

Makes sense, Appreciated!

This is a good idea that provides a single point to manage pre navigation logic will reduce redundancy across screens and simplifying updates by consolidating navigation related actions. But my concern is conditional navigation paths may complicate the flow it requires careful handling to avoid unplanned behaviors. May be if developers can enable or disable the Global On Before Navigate action on per screen basis to maintain flexibility. 

You could also make an 'OnInitialize' under the Layout webblock, in your Reactive front-end module.

This will allow you to define your logic once, and have it execute on every screen that uses the layout webblock. (Which is usually every screen except the Login screen).