Server Action Calling from Client Action is Recommended, why?

Why it is recommended to call server actions from only Client actions in Reactive Web ? What is the reason why we cannot call it directly on Screen Action.

Hi Raj,

I think the only reason is that you can use that client action from other screen actions as well. (reusable)

I don't see any performance impact in calling server actions directly from screen actions. however its not recommended to call the server action in the events like OnIntiaite  , Onrender that may impact the perfomance.

Best Regards

Devendra

You can call server actions on client actions and you can call server actions on server actions but you cannot call client actions on server actions.

What is recommended is, in a client action to call only a sever action because you don't want to call multiple times server-side actions when you can call just one time and that will not impact the performance on your app.

Have a look at this post

https://www.outsystems.com/forums/discussion/49836/difference-between-screen-action-server-action-and-client-action/

About Screen Actions:

"A Screen Action is an Action that's local to a Screen. It can only be called by Screen Elements (in Web) like Buttons or Links, or by a Notify of a Web Block. In Mobile, Screen Actions can also call each other. Screen Actions have local scope to the Screen (outside the Screen they are not visible), and have access to all Screen Input Parameters, Screen Local Variables and Widgets. Screen Actions are run either on the server (Web) or on the device (Mobile). Use Screen Actions for simple logic that's Screen-specific."

https://www.outsystems.com/forums/discussion/63402/actions-client-server-screen/

Regards,

Márcio

Hi Raj,

I think the only reason is that you can use that client action from other screen actions as well. (reusable)

I don't see any performance impact in calling server actions directly from screen actions. however its not recommended to call the server action in the events like OnIntiaite  , Onrender that may impact the perfomance.

Best Regards

Devendra

Hi, it is recommended because it's not a good practice to expose your server action on the client-side, hence we call the server via client action instead of calling server action directly.

Hi Raj,

I have never come across this recommendation, where can I find it ?  I don´ t see any reason for it, and Outsystems own scaffolding sure doesn´ t follow this rule.

Dorine

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