265
Views
6
Comments
Server Action & Screen Actions
Application Type
Traditional Web

Hi,

Can anyone help me with when to use the server actions and when to use screen actions?

I am aware that server actions perform logic on server and screen actions are screen specific. But There are some scenarios where we can assign server actions to the button. That is the reason I am little bit confused.

2022-09-29 10-53-19
José Campos

Hi @Xavior,


You can't assign a server action to the button's on click event. For the On Click event you have to use a screen or a screen action. If you want to perform something in the server, you have to create a screen action, assign it to the on click event, then call the server action.


Use this approach wisely. Too many server executions may result in a bad experience for multiple users. The screen/client actions are executed by the browser/smartphone. That means that the execution time is more related to the processing capacity of the client hardware. The server actions are executed by the server. That means if multiple users call the same action, every user will be affect.


In a reactive application, the best strategy is to use more times the screen/client actions to perform the application logic in the client side then the server actions.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi José,

Though you're right about not being able to assign a Screen Action to a button, Xavior labelled his post "Traditional Web", so Reactive Web constraints do not apply here.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Xavior,

Like José wrote, you cannot assign a Server Action to a button or link. A button/link can be either assigned a Screen Action or a destination (screen or external URL). Can you explain what "scenario" you thought allowed you to assign a Screen Action to a button?

2022-12-09 04-50-17
Shubham Doshi

Hi Kilian,

As you can see in the below image I have created some server actions for a basic calculator application in one core module


And I have called these server actions in another module inside the screen action of button. See the below image for reference



2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Yes, but then the button is still only calling the screen action, not directly the server action. So what exactly is your confusion?

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