27
Views
6
Comments
Solved
In a data structure, should we create a CRUD for each entity?
Question

In a data structure, should we create a CRUD for each entity?

Champion
Solution

Hi,

At least you need a Create and Update, normally we create CreateUpdate in the same action.

Regards

Thanks Paulo Torres..

Champion
Solution

Hello

Yes in Outsystems when ever we create a transaction Entity then 6 entity actions are already created.

Now to use these action we will wrap them into a server action and use it as wrapper action.
It depends on your requirement what wrapper action you want specific to your entity,

Thanks
Tousif Khan

Champion
Solution

Hi,

At least you need a Create and Update, normally we create CreateUpdate in the same action.

Regards

Thanks Paulo Torres..

Champion
Solution

Hello

Yes in Outsystems when ever we create a transaction Entity then 6 entity actions are already created.

Now to use these action we will wrap them into a server action and use it as wrapper action.
It depends on your requirement what wrapper action you want specific to your entity,

Thanks
Tousif Khan

Thanks Tousif Khan..

You only need the CRUD if the entity is exposed public AND exposed read-only AND you update, create or delete is outside of that module (in another module).

My advise is to avoid the CreateOrUpdate and make a separate Create and Update. In your code it should be clear if you intend to update an existing record or create a new record and not "gamble" what will happen ;-)

Note that a best practice wrapper for a save action looks like this:

So have a seperate path for Update and Create. Avoid the CreaterOrUpdate if at all possible, as it is slower, especially for Creates.

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