Using server action to create entity records

I'm very new to Outsystems and have gone through the associate developer training.   Now I am trying to create a small proof of concept application but I'm struggling with using server actions to create or update entity records.

I am successful with using the default CRUD actions that Outsystems creates but having those exposed as public is not a good practice.   Is anyone aware of a tutorial that helps explain how to accomplish this via server action?

Hi Josh,

You should create a business logic layer and all the request should pass there.

Front-End -> Business Logic -> Database

Regards,

João

Hi Josh Herron,

You can expose server actions that use entity actions, this will allow to change and modify them easily in future.

Maybe you want to see this post also:

https://www.outsystems.com/forums/discussion/35090/difference-between-the-entty-actions-and-server-actions/

Regards,

Joao Luis Santos wrote:

Hi Josh,

You should create a business logic layer and all the request should pass there.

Front-End -> Business Logic -> Database

Regards,

João

I get that, I'm talking about how to actually set up the server action to update the record.   For example, my Activity entity has a CreatedBy - User Identifier,  CreateDate- Date,  Status- Status Identifier   


My server action would have an input parameter of type Activity and then I just pass those values along to the CreateorUpdateActivity that I pull into the server action I'm creating?   I guess that's where I'm getting confused with how to actually pass the information along to the database.  (hence asking if there are tutorials available anywhere)



Solution

Hi! 

You use your CRUD Actions, that can be public, and those actions use themselves  the build in CRUDs. 

this is an example.

Hope this help

Graça

Solution