Generic server action for multiple screens

Hello All,

I have recently started learning and experimenting on the Outsystems 11.

I have a query now. Can a server action be made generic and used in multiple screens?

As far as i can understand, we create a screen action in which we add server action and that screen action is inside a particular screen.So, can that server action be called from a different screen or reusable in some way.

Regards,

Indranil

Indranil Dey wrote:

Hello All,

I have recently started learning and experimenting on the Outsystems 11.

I have a query now. Can a server action be made generic and used in multiple screens?

As far as i can understand, we create a screen action in which we add server action and that screen action is inside a particular screen.So, can that server action be called from a different screen or reusable in some way.

Regards,

Indranil

yes, you can create generic Server as well as Client Actions as per your requirement.

In order to make it generic, you can use Input variables to reflect respective behaviors.

Server Actions are used for encapsulating reusable logic. They can be Public, i.e. they can be Referenced by other eSpaces.

----------------------

While Screen Actions has direct access to the Screen's Variables and Preparation, &  it is only associated with its respective Screen only.

Thanks,

Assif



Indranil Dey wrote:

Hello All,

I have recently started learning and experimenting on the Outsystems 11.

I have a query now. Can a server action be made generic and used in multiple screens?

As far as i can understand, we create a screen action in which we add server action and that screen action is inside a particular screen.So, can that server action be called from a different screen or reusable in some way.

Regards,

Indranil

Hi Indranil,

   actually you can but you shouldn't.  Of course, this will depend on the way you want to use your code.

When you don't use aggregation to get your data you lose the optimization it offers. The platform doesn't know the fields you will use and send all data increasing the quantity and overload of information you need to send from/to the server.   There is an impact on the scafolding too.  It is possible you cannot use it.

I hope this could help you.

Best regards

Luck


Solution

Hi Indranil Dey,

Yes your right we can create re usable server actions under logic tab, it can be used in multiple places. You can find the below screen where i have created Get Users action. now this will be accessible with in module. In case you you want this to used in other modules then you need to make this as a public ( you can check below 2nd screen shot. )  



Solution

Luciano Schiavo wrote:

Indranil Dey wrote:

Hello All,

I have recently started learning and experimenting on the Outsystems 11.

I have a query now. Can a server action be made generic and used in multiple screens?

As far as i can understand, we create a screen action in which we add server action and that screen action is inside a particular screen.So, can that server action be called from a different screen or reusable in some way.

Regards,

Indranil

Hi Indranil,

   actually you can but you shouldn't.  Of course, this will depend on the way you want to use your code.

When you don't use aggregation to get your data you lose the optimization it offers. The platform doesn't know the fields you will use and send all data increasing the quantity and overload of information you need to send from/to the server.   There is an impact on the scafolding too.  It is possible you cannot use it.

I hope this could help you.

Best regards

Luck


By the way,

   keep in mind my recommendation is only valid when you try to use a generic aggregate. For other situations, follow what our fellows said.

Thanks

Luciano Schiavo wrote:

Luciano Schiavo wrote:

Indranil Dey wrote:

Hello All,

I have recently started learning and experimenting on the Outsystems 11.

I have a query now. Can a server action be made generic and used in multiple screens?

As far as i can understand, we create a screen action in which we add server action and that screen action is inside a particular screen.So, can that server action be called from a different screen or reusable in some way.

Regards,

Indranil

Hi Indranil,

   actually you can but you shouldn't.  Of course, this will depend on the way you want to use your code.

When you don't use aggregation to get your data you lose the optimization it offers. The platform doesn't know the fields you will use and send all data increasing the quantity and overload of information you need to send from/to the server.   There is an impact on the scafolding too.  It is possible you cannot use it.

I hope this could help you.

Best regards

Luck


By the way,

   keep in mind my recommendation is only valid when you try to use a generic aggregate. For other situations, follow what our fellows said.

Thanks




Hi Luciano,

Thanks for your reply.Rather i want to know, how can we make and use generic aggregations?Will it not be useful to have generic and reusable aggregations?Is it recommended?

Thanks,

Indranil

Sravan Vanteru wrote:

Hi Indranil Dey,

Yes your right we can create re usable server actions under logic tab, it can be used in multiple places. You can find the below screen where i have created Get Users action. now this will be accessible with in module. In case you you want this to used in other modules then you need to make this as a public ( you can check below 2nd screen shot. )  




Thanks Sravan for such clear response

assif_tiger wrote:

Indranil Dey wrote:

Hello All,

I have recently started learning and experimenting on the Outsystems 11.

I have a query now. Can a server action be made generic and used in multiple screens?

As far as i can understand, we create a screen action in which we add server action and that screen action is inside a particular screen.So, can that server action be called from a different screen or reusable in some way.

Regards,

Indranil

yes, you can create generic Server as well as Client Actions as per your requirement.

In order to make it generic, you can use Input variables to reflect respective behaviors.

Server Actions are used for encapsulating reusable logic. They can be Public, i.e. they can be Referenced by other eSpaces.

----------------------

While Screen Actions has direct access to the Screen's Variables and Preparation, &  it is only associated with its respective Screen only.

Thanks,

Assif




Hello Assif,

Thanks for your response.Your response is conceptual and clear.

Regards,

Indranil

Indranil Dey wrote:

Luciano Schiavo wrote:

Luciano Schiavo wrote:

Indranil Dey wrote:

Hello All,

I have recently started learning and experimenting on the Outsystems 11.

I have a query now. Can a server action be made generic and used in multiple screens?

As far as i can understand, we create a screen action in which we add server action and that screen action is inside a particular screen.So, can that server action be called from a different screen or reusable in some way.

Regards,

Indranil

Hi Indranil,

   actually you can but you shouldn't.  Of course, this will depend on the way you want to use your code.

When you don't use aggregation to get your data you lose the optimization it offers. The platform doesn't know the fields you will use and send all data increasing the quantity and overload of information you need to send from/to the server.   There is an impact on the scafolding too.  It is possible you cannot use it.

I hope this could help you.

Best regards

Luck


By the way,

   keep in mind my recommendation is only valid when you try to use a generic aggregate. For other situations, follow what our fellows said.

Thanks




Hi Luciano,

Thanks for your reply.Rather i want to know, how can we make and use generic aggregations?Will it not be useful to have generic and reusable aggregations?Is it recommended?

Thanks,

Indranil

Hi Indranil,

  imagine you will use parameters from your database in any part of your application. Would you create an aggregation any time you use it ?  It is better to create a generic load action with only one register. If some parts of systems use advanced sql, for instance, you can use it to populate the table records. 

So, use this concept with attention. Some reusable components can help or not, depending on the way you use it.