I call server action in client ! after data is fetched in aggregate ! and i got this warning , so whats the best practice to fix it ! ?
Hi @Omar AbdElhadi
When we are using server actions in a client action . There is a request going from browser to server . So when we are using many server action in a same client action so, it causes many request to server. That can slow down performance.
You are using server action directly to the client side which gives you warning !! so whenever you want to use the server action at client side always make reusable client action that use in screen action so you can avoid the warning!!
Also refer this chat link for more:
https://www.outsystems.com/forums/discussion/56141/warning-client-action-calls-several-server-actions-but-only-1-server-action-cal/#:~:text=When%20we%20are%20using%20server,That%20can%20slow%20down%20performance.
https://www.outsystems.com/forums/discussion/62194/security-warning-youre-exposing-a-database-operation-in-the-client-side-validat/
https://www.outsystems.com/forums/discussion/49836/difference-between-screen-action-server-action-and-client-action/
hope this ll work for you!!
Note: Answer is given in your Screen Shot itself..
Kind regards
Sourabh Sharma
Hi @Sourabh sharma,
In my scenario, server actions are wrapped inside one client action and that client action is used inside the OnAfterFetch event. Also, I cannot avoid this call. How can we fix this kind of issues?
Thanks,
Kiruthika
It is not about wrapping all server actions in one client action, that would still cause multiple calls to the server. It is about calling all the server actions in ONE server action, and then only call that one server action from your client action.
Thanks Daniel for clarifying my doubt. Let me try it out.