Allow redefining entity built-in actions (CRUD Wrappers)
7827
Views
165
Comments
On our RadarOn our Radar
Backend

There are plenty of scenarios in which the base built-in actions are not enough. For example, if creation of a specific entity record demands that other entity records be also created, or if certain restrictions apply that cannot be modeled with static "default values". Or simply because you want to audit operations over sensitive entities.


Currently the way to do this with the Agile Platform is clumsy: isolate entities in their own eSpace, make them available read-only, and create sets of actions to do the required tasks. This works, but:

  • It is ugly - when actually using those actions, you will not see them associated with entities; you need to remember that they need to be imported, look for them under "referenced actions", remember from which eSpace they come from - or go look in the entity list;
  • It can lead to errors - if a new developer in a project using the pattern, for some reason, is not properly informed, he might simply go into the eSpace and switch the read-only property off, anticipating that it being that way was an error.

One pattern that is usually followed is that for every entity, we expose them as public but read only. For that entities, we create our own CRUD actions to give us more control on database manipulation. 

My suggestion is that we can have some scaffolding actions that automatically create that server actions to be called from external modules, for example, right click on the entity -> generate CRUD actions.




Merged from 'Automatically generate CRUD server actions for entities' (idea created on 2017-07-20 05:50:15 by José Gomes), on 2017-07-21 07:53:33 by Gonçalo Borrêga
2019-07-08 11-04-35
Leonardo Fernandes
mvp_badge
MVP

I would prefer to customize the existing entity actions.

Much like the OnBeforeRequest/OnAfterResponse methods of REST services are able to change the request/response, we could have a way of customizing the logic for persisting and retrieving the entity from the database.



Merged from 'Automatically generate CRUD server actions for entities' (idea created on 2017-07-20 05:50:15 by José Gomes), on 2017-07-21 07:53:33 by Gonçalo Borrêga
2018-05-27 17-06-57
Paul Schmeddes
mvp_badge
MVP

I also prefer customizing the existing entity actions the REST services alike. This leaves scaffolding intact and ensures that the added logic is always executed. 

We also create our own public crud server actions. Within the entity's espace one still can use the entity actions, to prevent this we must check the usage during code reviews.



Merged from 'Automatically generate CRUD server actions for entities' (idea created on 2017-07-20 05:50:15 by José Gomes), on 2017-07-21 07:53:33 by Gonçalo Borrêga
2016-04-21 20-09-55
J.
mvp_badge
MVP

similar to https://www.outsystems.com/ideas/624/allow-redefining-entity-built-in-actions ?




Merged from 'Automatically generate CRUD server actions for entities' (idea created on 2017-07-20 05:50:15 by José Gomes), on 2017-07-21 07:53:33 by Gonçalo Borrêga
2016-11-21 23-23-05
Gonçalo Borrêga
Merged this idea with 'Automatically generate CRUD server actions for entities' (created on 2017-07-20 05:50:15 by José Gomes)
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Add scaffolding working CRUD wrappers' (created on 07 Aug 2018 06:19:40 by Eduardo Jauch)
2020-02-28 09-46-54
Eduardo Jauch
mvp_badge
MVP

Would be nice to be able to automatically add CRUD wrappers to entities, used by scaffolding operations.

This way, we would be able to set the Public/Read only properties correctly from the start, without having to set in a way to allow scaffolding just to have to create the wrappers and refactor everything later.



This comment was:
- originally posted on idea 'Add scaffolding working CRUD wrappers' (created on 07 Aug 2018 by Eduardo Jauch)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:36:42 by Justin James
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Business Level CRUD' (created on 05 Jul 2018 13:00:19 by Bob Matthyssens)

When a new entity is created a few elementary actions are created.

It's a good habit to use these actions in a set of business level actions and avoid using these elementary actions directly.

I think it would be nice to create these business actions automatically and provide them with calls of their elementary level actions.  At this time it's possible to disallow the usage of the elementary actions on another level than the business layer.  People cannot skip the business layer.



This comment was:
- originally posted on idea 'Business Level CRUD' (created on 05 Jul 2018 by Bob Matthyssens)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:37:29 by Justin James
2016-04-21 20-09-55
J.
mvp_badge
MVP

Hi,


Great idea, but I think there are similar ideas already floating about...




This comment was:
- originally posted on idea 'Business Level CRUD' (created on 05 Jul 2018 by Bob Matthyssens)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:37:29 by Justin James
2019-11-12 17-31-26
Justin James
mvp_badge
MVP

Yes, there are a number of existing ideas around this.

J.Ja



This comment was:
- originally posted on idea 'Business Level CRUD' (created on 05 Jul 2018 by Bob Matthyssens)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:37:29 by Justin James
Changed the category to
Backend


This comment was:
- originally posted on idea 'Business Level CRUD' (created on 05 Jul 2018 by Bob Matthyssens)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:37:29 by Justin James
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Custom actions associated with entities' (created on 07 Sep 2015 10:14:43 by Kilian Hekhuis)
2020-09-15 13-07-23
Kilian Hekhuis
mvp_badge
MVP
As a best practice, we typically have an eSpace that contains the entities for a given application, expose them read-only for use in queries, and have specific actions to save and delete records (which typically involve data validations and set some flag indicating deletion respectively). These actions naturally live on the Action tab in Service Studio. It would be nice to be able to associate them with the entities they pertain to, so that referencing the entities would automatically reference these actions (similar to the platform default Get, Update etc. entity actions are). Note that this is not the same as this idea (which is also great), as that's about automatic triggers.

This comment was:
- originally posted on idea 'Custom actions associated with entities' (created on 07 Sep 2015 by Kilian Hekhuis)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:38:16 by Justin James
2020-02-04 07-58-32
Matthias Preuter
mvp_badge
MVP
So this should be a override of the existing platform Get / Update / Delete Entity actions?

This comment was:
- originally posted on idea 'Custom actions associated with entities' (created on 07 Sep 2015 by Kilian Hekhuis)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:38:16 by Justin James
2016-04-21 20-09-55
J.
mvp_badge
MVP
after rereading I finally understand what you mean, I think....

you want to attach public actions to that entity (and my guess is, you want to hide the common actions of that same entity)
in old school programming, it's inheritance, encapsulating and controlling :)

so, I agree 100%.
It's in the line of having better control of what other modules are allowed to do, how to do it and what not to do!




This comment was:
- originally posted on idea 'Custom actions associated with entities' (created on 07 Sep 2015 by Kilian Hekhuis)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:38:16 by Justin James
2020-09-15 13-07-23
Kilian Hekhuis
mvp_badge
MVP
@Matthias: more or less. If you expose an entity read-only, there are no Update/Delete actions, and we implement them ourselves typically.

@J.: Yes, that's what I mean.


This comment was:
- originally posted on idea 'Custom actions associated with entities' (created on 07 Sep 2015 by Kilian Hekhuis)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:38:16 by Justin James
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Ability to add new Entity Actions' (created on 15 Dec 2011 11:12:48 by Mário Araújo)
2018-05-07 20-49-39
Mário Araújo
It would be interesting to be able to extend the existing entity actions with custom logic or to even add new actions under an entity


 .

This comment was:
- originally posted on idea 'Ability to add new Entity Actions' (created on 15 Dec 2011 by Mário Araújo)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:39:22 by Justin James
We have wrapped a lot of the entity actions and have to shove them in folders in the logic section. It would be visually cleaner and more convenient to put our wrapped actions here. 

This comment was:
- originally posted on idea 'Ability to add new Entity Actions' (created on 15 Dec 2011 by Mário Araújo)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:39:22 by Justin James
Frequently is necessary to create rules for getting, creating, updating or deleting records so it would be nice to simplify this process, i think that it could be achieved by right clicking in entity actions and selecting "Pre Processing" or "Post Processing" with actions attached to each option.

This comment was:
- originally posted on idea 'Ability to add new Entity Actions' (created on 15 Dec 2011 by Mário Araújo)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:39:22 by Justin James
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Automatic generation of fields and actions' (created on 04 Jun 2018 15:28:55 by Margarida Morais)

The fields CreatedBy, CreatedAt, UpdatedBy and UpdatedAt are often required. 

We spend a lot of time adding this fields and creating actions that encapsulate CRUD actions and fill these fields.

I propose a wizard that when creating an entity allows the user to:

  • select the automatic addition of the fields CreatedBy, CreatedAt, UpdatedBy and UpdatedAt
  • select the automatic generation of actions that encapsulate the CRUD actions and fill this fields.


This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James
2016-04-21 20-09-55
J.
mvp_badge
MVP
Merged this idea with 'Standard "Created/Changed On/By" attributes for entities' (created on 19 Dec 2014 14:04:15 by Erdal Yalcin)

This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James
It would be nice to be able to check in the Entity's properties whether it should automatically record for each record entry in thetabase by who (user.Id) and when it was created or changed, so:
- CreatedBy
- ChangedBy
- CreatedOn
- ChangedOn

No we all seem to make these manually for those entities we like to record this for.


Merged from 'Standard "Created/Changed On/By" attributes for entities' (idea created on 19 Dec 2014 14:04:15 by Erdal Yalcin), on 06 Jun 2018 08:49:37 by J.

This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James
2016-04-21 20-09-55
J.
mvp_badge
MVP

blimey, it was on the radar, but the merge got it removed somehow :(




This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

I totally support this, it would be nice even if it was just to create the standard wrapper without any filling of fields, we waste too much time doing those wrappers (boring, repetitive work)



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

Also nice if it could be a bit generic and you could define templates for fields/actions and then have those actions be created when you create an entity or by clicking on the entity and have an option like "Create Templates" 



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James
Changed the category to
Backend


This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James
Changed the status to
On our RadarOn our radar

Thank you so much for the suggestion, is something we have on the radar to be implemented, nevertheless is not yet settled when and how.

In order to have more insight can I ask your feeling on the following questions:

  • Instead of a wizard when creating the entity, would be Ok to be a property on the entity? 
  • How often this fields depend on business rules to be filled-in? Could they be filled-in automatically?

Thanks




This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James
2016-04-21 20-09-55
J.
mvp_badge
MVP

my 2 cents on the subject.

It is a bit strange that outsystems suggest a certain architecture where you also need to have entities to public=yes, but read-only. This forces us to create almost the boring wrappers around the crud-actions.

If this could be implemented when swapping the public=yes to aks a dialog "create wrappers? or something like that and it will be smart enough to see if there are createdBy, updateBy etc.. it should be rather easy to create the wrappers as we like to see?




This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

99% of the time it's "if id = null then set created on and created by to now and current user, and always set updated by for the same"


What you mean a property of the entity? How would it create actions based on a property?



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James
2016-04-21 20-09-55
J.
mvp_badge
MVP

I *think* it would be something in the advanced properties like "identifier", plural etc...




This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

Yes. IMHO, these 4 fields should be like checkboxes / options in the advanced properties. And when checked, would be created automatically in the entity. 2 possible scenario's:

  1. Fields are not changeable by any logic. If user wants that, he could still manually create additional attributes instead of these. So here, fields are filled in automatically (and always!) without the need for setting them in logic
  2. Have them be changeable by logic (and even initial setting manually? Although then there would be little benefit of automation of repetitive work)


This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

Actually what i was suggesting were two things:

  • be able to automatically generate the fields. 
  • something like what we have on eclipse to automatically create methods. 

It would be very helpful if the fields were filled automatically. However, if Outsystems could automatically create generic actions, we would be able to add/change the code for particular situations.



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

Yesterday i had to create wrappers for 45 entities by hand (had to refactor something), anything that helps in this  would be great :P

My 45 entities are local and dont have createdby/on and updatedby/on fields, it was literally doing an "automated" chore by hand.



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

I think of those two points the second one is especially useful, the fields you can simply Copy/Paste, the actions take alot more time to replicate.



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

Thanks for the great feedback we will take it into consideration.


There are a couple of scenarios like Timers and BPT that the user is not logged in, therefore CreatedBy or UpdatedBy either are empty or depend on business rules.


Regarding creating the wrappers is also one thing that is on our radar and is already mentioned on following idea.



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

Dont forget the Delete actions :P

and for mobile, create all and delete all eheh

Good to know that they will be done eventually, keep up the good work.



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

Action wrappers for Entities would be awesome, Validation of these actions should also be included based on entity constraints



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

It would be nice to be able to flag a table as "Audit" in advanced properties, and then have OutSystems automatically capture data and time and userid in an OutSystems table specifically for this purpose maybe through a trigger/stored procedure. Couple it with an Audit component for access. The we could simply just check the box for tables we needed an Audit Trail for and not have all these additional attributes on each table.



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

In my option, the entity could have:

And, if I pick "Yes", the fields will be created.





This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

It's even better to specify exact attributes here because names could be different



This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James

If you have these four attributes on a table 

1. It does not give you a history of change, only who last changed the entity record.

2. It increases the size of each table where its not necessary

3. It does not handle (as someone said) the "Delete" case.

If you have a simple audit component you can track all of the things you want to track, or not




This comment was:
- originally posted on idea 'Automatic generation of fields and actions' (created on 04 Jun 2018 by Margarida Morais)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:40:59 by Justin James
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 17:12:25 by Miguel Sousa)

An Entity should have an option to automaticly generate a Entity_CreateOrUpdate action with server side validations, taking into account the properties of the attributes in the Entity (E.g. mandatory fields). In this way, we would have basic validation per entity in the Core Service modules and not only in the End User Modules. 



This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James
2020-12-08 09-54-09
Evert van der Zalm
mvp_badge
MVP

I agree this can be helpfull, but I think everybody models this kind of functionality in a different way. So it should be configure (folder, name of the created action, which validations) else you'll end up with adjusting a lot.



This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James
2016-04-21 20-09-55
J.
mvp_badge
MVP

Well, I disagree with Evert. imho, those wrappers should be structured like already created actions:


<entityname>

-createorupdate

-create

-..


and tbh, i don't care on this low level naming ;)






This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James
Merged this idea with 'Would the use of validation server actions be an option?' (created on 20 Jun 2018 12:17:50 by René Cornet)

This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James

Instead of validating alterations (add, modify and delete) on tables at several places in parts of modules that approach these tables, it might be better, in my opinion, to perform these validations in special server actions. Maybe it is even better to create a special module for it that is stacked on the ‘Core’ module. Validations, for a specific alteration on a certain table, are always performed the same way in that case, no matter where the server action is initiated (screen, process …).


Having these special server actions, it is also easy to perform inter table validations. The deletion of a record of table A might result into an update of table B. If the update of the B-record is not allowed due to its validations, the deletion of the A-record may not take place either. This implies that the server action ‘ValidationCreateOrUpdateTableB’ is started within ‘ValidationDeleteTableA’. To instruct the caller, an output parameter should return the result of the validation. So, the outcome might be a description about the validation error or just empty if okay.


Introducing the validation server actions will imply that the database actions ‘CreateOrUpdateTable’, ‘CreateTable’, UpdateTable’ and ‘DeleteTable’ should not be used anywhere outside their validation server actions anymore.


The ‘ValidationCreateOrUpdateTable’ server action should check whether the input Id prameters is empty or not. If empty (nullIdentifier), the ‘ValidateCreateTable’ action should be started. When this action returns an empty value (a correct validation and an insertion), a new Id is returned as well. However, when the action returns an error description, the complete action should be cancelled. If the insertion is correct, but the following update is not correct, an abort transaction should be performed to undo the insertion in that case.


Would the use of validation server actions be an option?



Merged from 'Would the use of validation server actions be an option?' (idea created on 20 Jun 2018 12:17:50 by René Cornet), on 02 Jul 2018 09:57:06 by Fernando Moitinho

This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James

Hello René,

First, what is your Idea behind this?

Second, that's what you should do based on your use cases and business logic that your application requires. 

They depend very much on the business logic that you need to implement and aren't equal to everyone. 


The Server actions you talk should be in same module where you have the Entities and only those server actions should be public and your entities should be public and Read-Only.


Abílio Matos



Merged from 'Would the use of validation server actions be an option?' (idea created on 20 Jun 2018 12:17:50 by René Cornet), on 02 Jul 2018 09:57:06 by Fernando Moitinho

This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James

Hello Abilio,

The idea behind it is to have a single point of validation per table access type (create, update, delete).

I was creating an application in which records could be altered on the screen and records could be altered via JSON Restful webservices. For both entry points I was coding validations. So, i decided to call a server action for each validation.

I agree it is even better to store the validation table access actions in the database layer itself. Do you know if there is any documentation (course) about this topic?


René Cornet  



Merged from 'Would the use of validation server actions be an option?' (idea created on 20 Jun 2018 12:17:50 by René Cornet), on 02 Jul 2018 09:57:06 by Fernando Moitinho

This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James

René,

This topic is also approached in 4 Layer Canvas architecture and in several courses, some more encapsulated than others, like the ones from Becoming a Web Developer guided path.


Abílio Matos



Merged from 'Would the use of validation server actions be an option?' (idea created on 20 Jun 2018 12:17:50 by René Cornet), on 02 Jul 2018 09:57:06 by Fernando Moitinho

This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James
2019-11-12 17-31-26
Justin James
mvp_badge
MVP

This is standard architectural practice.

THAT SAID...

The system does not support it well. For example, the drag/drop stuff more or less breaks down once you start using four layer canvas.

There are a number of related, but not identical ideas (nothing close enough for me to merge these) out there already.

J.Ja



Merged from 'Would the use of validation server actions be an option?' (idea created on 20 Jun 2018 12:17:50 by René Cornet), on 02 Jul 2018 09:57:06 by Fernando Moitinho

This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James

Hi Fernando, 

What I actually intended to say is more about functional validations. Technical validations are performed very well by the current statements for adding, updating and deleting records, but is it also functionally allowed to delete a record,  do I need to update another table when I create a record, ... ? These functional validations should be performed, in my opinion, at one point per table and per table access type. The technical validations are performed during the actual table action.

René



This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James

Hi René,

I've merged your idea with an already existing one. The main goal is to have automatically generated actions for Create / Update / Delete where the user can customize this action to fulfill business requirements.

Thanks,



This comment was:
- originally posted on idea 'Entity - Generated "Create Or Update" Entity Actions' (created on 15 Nov 2017 by Miguel Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 08 Aug 2018 03:41:30 by Justin James
2019-11-12 17-31-26
Justin James
mvp_badge
MVP

To summarize a number of very similar and related ideas:

1. We want OutSystems to NATIVELY support the idea that CRUD wrappers need to exist and should be customizable by the developer.

2. We want OutSystems to NATIVELY support Created & Updated By/On fields, and preferably an audit/change history field as well. Adding these fields to the entity should be as easy as turning on multi-tenancy (checkboxes in advanced properties).

3. The CRUD wrappers in item 1 should be auto-generated, preferably creating validations based on entity and attribute metadata (for example, if the Label attribute is required, build a check that says "If Length(Label) = 0, send a friendly message that Label is required" and "if Length(Label) > Label.MaxLength, send a friendly message that Label is too long", etc.).

4. The fields from item 2 should be autopopulated (but done in a manner than can be overwritten by the developer) in the auto-generated CRUD wrapper.

5. The DELETE CRUD wrapper would ideally auto-generate checks for existing data for any child entities with delete rule of "protect" and make a friendly warning like "Cannot delete the Customer record 'Jim Smith' because the Invoice record '2018-03-13' depends on 'Jim Smith'" (using the fields marked as "Label" attribute for each of these entities). In addition, this DELETE CRUD wrapper should be aware of soft deletes, and perform a soft delete (WITHOUT the data integrity check) on the record if IsActive is on for the entity.

6. Furthermore, once the system is auto-generating customizable CRUD wrappers, this SHOULD also take the place of the various "friendly DB error messages" Ideas on the Idea board.

J.Ja

Changed the category to
Backend
Changed the category to
Backend
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Automatic CRUD actions' (created on 21 Aug 2018 21:16:04 by Filipe Silva)

On right click on a entity we could have an option to create a basic wrapper of the CRUD actions of the entity.



This comment was:
- originally posted on idea 'Automatic CRUD actions' (created on 21 Aug 2018 by Filipe Silva)
- merged to idea 'Allow redefining entity built-in actions' on 23 Aug 2018 13:24:07 by Justin James
Merged this idea with 'Be able to add logic to an entity.' (created on 02 Sep 2015 13:10:09 by Sophia Retief)
I have logic that must occur every time a new record is created for a given entity.  These records can be created from different places but in each case the same logic must always occur.  It would be great if I could add logic to the entity which would then always be processed.  Example I need to add the user who created or modified the record as well as when it was created or last modified.  I would like to add this logic once and not have to worry that when someone else adds to this record that this functionality will be missed.


This comment was:
- originally posted on idea 'Be able to add logic to an entity.' (created on 02 Sep 2015 by Sophia Retief)
- merged to idea 'Allow redefining entity built-in actions' on 07 Sep 2018 15:02:54 by Vasco Pessanha
2016-04-21 18-13-58
Nuno Rolo
mvp_badge
MVP
Hi Sophia,

For that example you can create an user action public with that login inside and in the end call the createorupdate of the entity.
Also for more complex logic you can use process (BPT).

This comment was:
- originally posted on idea 'Be able to add logic to an entity.' (created on 02 Sep 2015 by Sophia Retief)
- merged to idea 'Allow redefining entity built-in actions' on 07 Sep 2018 15:02:54 by Vasco Pessanha
2020-09-15 13-07-23
Kilian Hekhuis
mvp_badge
MVP
It would indeed be nice to have an OnCreate, OnMofify and OnDelete action associated to an entity.

This comment was:
- originally posted on idea 'Be able to add logic to an entity.' (created on 02 Sep 2015 by Sophia Retief)
- merged to idea 'Allow redefining entity built-in actions' on 07 Sep 2018 15:02:54 by Vasco Pessanha
2016-04-21 20-09-55
J.
mvp_badge
MVP
It should be much more easier to wrap entities by custom actions.

(and be able to do the same with entities from an extension)



This comment was:
- originally posted on idea 'Be able to add logic to an entity.' (created on 02 Sep 2015 by Sophia Retief)
- merged to idea 'Allow redefining entity built-in actions' on 07 Sep 2018 15:02:54 by Vasco Pessanha
2020-09-15 13-07-23
Kilian Hekhuis
mvp_badge
MVP
Yeah, hence my Idea here.

This comment was:
- originally posted on idea 'Be able to add logic to an entity.' (created on 02 Sep 2015 by Sophia Retief)
- merged to idea 'Allow redefining entity built-in actions' on 07 Sep 2018 15:02:54 by Vasco Pessanha
2017-07-05 12-29-36
Carlos Alfaro
mvp_badge
MVP
Merged this idea with 'Automatic generation of getters and setters, for entities.' (created on 19 Nov 2018 13:10:44 by Emidio Correia)

- It'll be be very nice if we can right click on an entity and choose 'generate getters and setters'. The CRUD operations are identical in some content. And the developer can add/remove/complete the code.

This feature will create API's according the best practices and corresponding entity structure in a core component. And it can be more complex with some options.



This comment was:
- originally posted on idea 'Automatic generation of getters and setters, for entities.' (created on 19 Nov 2018 by Emidio Correia)
- merged to idea 'Allow redefining entity built-in actions' on 19 Nov 2018 14:03:05 by Carlos Alfaro

Very good idea. For the _CS modules this would greatly speed up the work.



This comment was:
- originally posted on idea 'Automatic generation of getters and setters, for entities.' (created on 19 Nov 2018 by Emidio Correia)
- merged to idea 'Allow redefining entity built-in actions' on 19 Nov 2018 14:03:05 by Carlos Alfaro
2020-09-15 13-07-23
Kilian Hekhuis
mvp_badge
MVP
Merged this idea with 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 11:26:56 by Miguel Vicente)

This would be great if you could with a right click on top of an entity to generate the CRUD actions split by folder for example.



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis
Changed the category to
Service Studio


This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis

Hey Miguel,

What do you mean by creating CRUD actions? Entity actions already appear under each entity.

Are you talking about creating wrapper actions in specific folders?

Cheers,



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis

Hey Vasco,


I mean having entities as read-only and then create automatically in "Logic" tab all the CRUD action for then consume in other modules instead of using the CRUD actions direct from entities. 

One of the reasons to make this CRUD actions is to match with architecture best practices.

An example:

Thank you,

Cheers,

Miguel Vicente



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis

Oh, got it!

My question is that if these actions are not custom for each scenario/project/customer. If it is, we would just be accelerating the creation of 3 actions that the user would have to review, implement and customize. Wondering how this helper would actually accelerate your work.

Cheers,



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis

Hey, 

90% of the use cases are to set the CreatedBy, CreatedOn, UpdatedBy, UpdatedOn, and IsActive. So in most of the times, we need to spend some time on creating this actions just to assign this fields. 

For sure this will improve developers time at the beginning of their projects and we are also helping them to follow the best practices. 

Disadvantages, when you set your entities as read-only you are unable to create screens with scaffolding. 

Cheers,

Thanks



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis

Completely agree that we need something like this. We always create a save, savecore and validate actions. We need custom action templates!



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis
2021-07-22 16-16-55
Edgar Ramos
Champion

In all of the clients and projects I've been so far this is something that is always implemented.



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP

I agree to all above that we need action templates, but one problem that should also be solved is that for a readonly entity the scaffolding of screens generates "readonly" screens without add and update.

This should be configurable, we in pricinple always put entities on readonly, but for screen scaffolding to work you need them on readonly false.



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis

Daniel, completely agree!


Edagar, I agree, people always do that. The thing that really bothers me on that flow, the inline ifs... it's a visual language!



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis

What would be great is extending the templating functionality so that it works with more than just espaces. For example being able to set a template for the entity creation could pre create certain fields and pre create the crud operations allowing us to then just add the missing details. Might be worth a new idea of its own.





This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis
Changed the status to
On our RadarOn our radar

Thanks for the idea!



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis
2020-09-15 13-07-23
Kilian Hekhuis
mvp_badge
MVP

I think that Entities should have these CRUD actions as Properties, a bit like the On After Response of REST services for example, or the On Xxx of Mobile Screens. So you could either right click them and select "Create Update Action" or something, and it would be attached to that Entity, or you could select any Screen Action as a Property.



This comment was:
- originally posted on idea 'Entities advance properties to generate automatic CRUD actions' (created on 11 Dec 2018 by Miguel Vicente)
- merged to idea 'Allow redefining entity built-in actions' on 20 Dec 2018 09:48:34 by Kilian Hekhuis
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with '' (created on 01 Jan 1900 00:00:00 by )
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with '' (created on 01 Jan 1900 00:00:00 by )
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Encapsulation for Create, Update and Delete operations of entities' (created on 21 Jan 2019 12:45:07 by Kadir Özcan)

Hello,

It would be nice to let Outsystems automatically generate getter and setter actions for Create, Update or Delete actions of entities. Maybe the user can do this via a context menu option or a keyboard shortcut.



This comment was:
- originally posted on idea 'Encapsulation for Create, Update and Delete operations of entities' (created on 21 Jan 2019 by Kadir Özcan)
- merged to idea 'Allow redefining entity built-in actions' on 22 Jan 2019 04:16:48 by Justin James

Great idea, Kadir!

It would be a nice way to foster the adoption of architecture best practices, by making the creation of API CRUD actions less time-consuming.


Cheers!



This comment was:
- originally posted on idea 'Encapsulation for Create, Update and Delete operations of entities' (created on 21 Jan 2019 by Kadir Özcan)
- merged to idea 'Allow redefining entity built-in actions' on 22 Jan 2019 04:16:48 by Justin James
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Automatic CreateOrUpdate and Delete Actions for a readOnly entity' (created on 14 Feb 2019 18:07:31 by João Sousa)

When you have a public readOnly Entity, make an option to generate the standart CreateOrUpdate{Entity} and Delete{Entity} server actions that we can consume from other espaces. We can then customize these actions with our validations if we want to



This comment was:
- originally posted on idea 'Automatic CreateOrUpdate and Delete Actions for a readOnly entity' (created on 14 Feb 2019 by João Sousa)
- merged to idea 'Allow redefining entity built-in actions' on 15 Feb 2019 17:20:16 by Justin James
Merged this idea with 'Public DB Action Accelerator' (created on 07 Mar 2019 20:17:24 by Nick MATES)

Being able to right click a CRUD operation of an Entity in a core module and automatically generating a corresponding Server Action to be exposed to the Front End UI module would promote OutSystems Data Architecture best practices in addition to saving a significant amount of time at application creation.



This comment was:
- originally posted on idea 'Public DB Action Accelerator' (created on 07 Mar 2019 by Nick MATES)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 09:46:44 by Fernando Moitinho
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Entity CRUD Callbacks' (created on 21 Sep 2018 21:53:01 by Miguel Seabra Melo)
2020-10-15 10-24-31
Miguel Seabra Melo
mvp_badge
MVP

Add the possibility of adding a before and/or after callback to Entity Actions. 

As an example, for an "Item" entity, being able to create an OnBeforeCreateItem and OnAfterCreateItem would allow one to centralize some business rules (e.g. validate the record before, or increase stock after) while people still called the "normal" CreateItem entity action.

This is a lot more obvious than the current pattern of having to make the entity readonly and creating a public Item_Create action, that's not immediate to relate as the CRUD substitute of the Entity action. It's also orthogonal to how REST calls work.



This comment was:
- originally posted on idea 'Entity CRUD Callbacks' (created on 21 Sep 2018 by Miguel Seabra Melo)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:06:55 by Fernando Moitinho
2019-11-12 17-31-26
Justin James
mvp_badge
MVP

I would MUCH rather have the system just support proper CRUD wrappers out of the box, rather than make them something you need to learn about, then break the entire scaffolding system to use (especially since this is backwards compatible to 17 years of existing code, just specify which actions are the CRUD wrappers).

J.Ja



This comment was:
- originally posted on idea 'Entity CRUD Callbacks' (created on 21 Sep 2018 by Miguel Seabra Melo)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:06:55 by Fernando Moitinho
Merged this idea with 'CRUD's actions for external DB' (created on 28 Feb 2019 15:44:24 by Carlos Mendes)

Hey everyone,

For entity / table created in OutSystems, these are accompanied with the CRUD's actions that can later be encapsulated in actions to be used in the applications, this to follow the best practices.


In the case of external entities / tables, there is no automatic mechanism for generating these encapsulated actions of CRUD.

There could be an automatic mechanism that would create these CRUD actions to accelerate development and reduce errors.

See ya



This comment was:
- originally posted on idea 'CRUD's actions for external DB' (created on 28 Feb 2019 by Carlos Mendes)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:07:44 by Fernando Moitinho
Merged this idea with 'Entity CRUD operation management' (created on 22 Jan 2019 18:27:18 by Robert B)

There may be times that you want to maybe do only the CRU of CRUD on an entity that is in a Core module. The only way to expose an entity to anything other than just read is to expose all of it's features. It seems a bit much to lock it down by creating actions for only the operations in CRUD that you want to expose (especially if you only want to say, not expose deleting), so maybe if you turn off Read Only mode, there could be a checkbox for each of the default bahaviors that come with an entity that can easily turn access off and on to them.



This comment was:
- originally posted on idea 'Entity CRUD operation management' (created on 22 Jan 2019 by Robert B)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:09:07 by Fernando Moitinho
Changed the category to
Backend


This comment was:
- originally posted on idea 'Entity CRUD operation management' (created on 22 Jan 2019 by Robert B)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:09:07 by Fernando Moitinho

You can easily overcome this by creating a wrapper for the action that you want to expose. 



This comment was:
- originally posted on idea 'Entity CRUD operation management' (created on 22 Jan 2019 by Robert B)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:09:07 by Fernando Moitinho

Robert,

Best practices for Core modules entities say that you should always do your server actions for CRUD.

Core Service abstraction


Regards

Abílio Matos



This comment was:
- originally posted on idea 'Entity CRUD operation management' (created on 22 Jan 2019 by Robert B)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:09:07 by Fernando Moitinho

Roman Tkachenko: writing code to replicate already existing behavior is not considered a smart solution in my book. If they are willingly going to provide a fully exposed set of CRUD operations, then the answer should not be: "If you want only certain ones exposed, go write a wrapper to do what we already did for you (oh by the way, if you want all of them though, we'll let you do that)". That's making people do needless work to accomplish something the system could help you manage.

Abilio Matos: I'd like to know why it's a best practice. Say you have absolutely no business logic code that needs to sit between the function and the actual operation happening, why does someone need to do tedious work that already exists in the framework? And that's fine if everyone, including Outsystems, wants to consider it best practice.

I only gave the above idea because Outsystems is obviously OK with exposing everything publicly with no wrappers. However, if they cared so much about "best practices" they could just not allow any exposing of operations and force people to follow what everyone seems to call "best practices". That's the REAL solution. However, since Outsystems insists on allowing exposing the raw operations, then they should at least allow you to remove access to them with a checkbox. There's  no harm in that if they are already going to allow you to expose them all anyway.



This comment was:
- originally posted on idea 'Entity CRUD operation management' (created on 22 Jan 2019 by Robert B)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:09:07 by Fernando Moitinho

Robert, 

That is OutSystems best practice so you need to ask them.

Also, in those wrappers you could do some validations to check if everything is ok and then call the CRUD created automatically by platform. Other thing you have is to control where your CRUD operations happen instead of allow every consumer modulo to do them as they want.


Abílio Matos



This comment was:
- originally posted on idea 'Entity CRUD operation management' (created on 22 Jan 2019 by Robert B)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:09:07 by Fernando Moitinho

Don't get me wrong. I am not bashing what people are considering best practices. I totally get why. However, the fact of the matter is that in spite of these best practices (that even OutSystems agrees with) they continue to let you expose all (or none) of the operations. So, if they are going to continue to do so, I think it would be a useful option to allow you to select which ones, that way you can still lock down which operations are available to developers if you elect not to wrap everything in actions. If they didn't think that was a viable way to expose and utilize entity operations, then they would just block them entirely and force you to write actions. Which is a time-consuming set of work to do for every entity just to keep people from, say, being able to Delete. Like I said, the REAL answer is never let there be a public option, but that isn't the current state of things, so my idea is born of this current state.

There are always valid exceptions to rules and even Best Practices (since BPs are merely guidelines and not even rules).



This comment was:
- originally posted on idea 'Entity CRUD operation management' (created on 22 Jan 2019 by Robert B)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:09:07 by Fernando Moitinho

Will it be a 'useful option'? Yes. 

Is it that bad to have a proxy to the CRUD operations? I don't think so. I would say it's really rare when you need those clean CRUD operations without any additional logic. 



This comment was:
- originally posted on idea 'Entity CRUD operation management' (created on 22 Jan 2019 by Robert B)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:09:07 by Fernando Moitinho

Then don't let people publicly expose them and you enforce Best Practice.



This comment was:
- originally posted on idea 'Entity CRUD operation management' (created on 22 Jan 2019 by Robert B)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:09:07 by Fernando Moitinho
2019-11-12 17-31-26
Justin James
mvp_badge
MVP

Robert -

There's a fundamental conflict baked into the platform between "best practices that make a well-built application" and "features in the product that make a snazzy 'build an app in 5 minutes!' demo, or that let 'citizen developers' put an app together". :( It's not just in the CRUD wrappers, it's in stuff like how to build menus too.

There has been a very strong push from the community for a while now to resolve this by making CRUD wrappers a feature supported inherently by the product, including the "scaffolding" system (drag/dropping screens together that makes the fireworks appear). It is currently very difficult for people who are new to the platform to go from "but in the demos I saw sales build this screen in 5 minutes!" to "yes, but to do it right takes 2 hours" or whatever. It is even more painful when they never learn the best practices. I have make a LOT of money coming behind teams that followed the basic training and demos and drag/dropped their way into a nightmare code base, and fixing it to best practices once issues like circular references made deployment impossible.

J.Ja



This comment was:
- originally posted on idea 'Entity CRUD operation management' (created on 22 Jan 2019 by Robert B)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Mar 2019 10:09:07 by Fernando Moitinho
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Enhance validation process' (created on 02 Apr 2019 14:19:08 by Moamen Naanou)

I believe it is better to let users define their own validation rules in a centralized module or make validations entity-based.

Creating multiple "if" statements to support validations in the code is not used anywhere, every platform has its own validation library (i.e. .Net is supported by https://fluentvalidation.net/   which is very useful, or even we can create the validations natively on every model using annotations - attributes-) .


If we can have a tool in OutSystems similar to "Fluent Validation", it will be great!


Thanks.



This comment was:
- originally posted on idea 'Enhance validation process' (created on 02 Apr 2019 by Moamen Naanou)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 03 Apr 2019 03:17:06 by Justin James
2019-11-12 17-31-26
Justin James
mvp_badge
MVP

What you need to do is write CRUD wrappers.

J.Ja



This comment was:
- originally posted on idea 'Enhance validation process' (created on 02 Apr 2019 by Moamen Naanou)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 03 Apr 2019 03:17:06 by Justin James
Merged this idea with 'Generate wrappers for CRUD operations' (created on 09 May 2019 15:37:11 by Sima Ilic)

Best practice for CRUD operations is to wrap them so that the application can control who, when and how modifies the data. Building these wrappers manually is tedious. Automatic generation of the wrappers with all attributes added and the action to call the entity operation would be a big time saver.


Sima



This comment was:
- originally posted on idea 'Generate wrappers for CRUD operations' (created on 09 May 2019 by Sima Ilic)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 09 May 2019 16:15:55 by Fernando Moitinho
Merged this idea with 'CRUD API - OnBefore and OnAfter Actions' (created on 07 Jul 2019 09:08:32 by Tiago Bojikian Costa Vital)

The Idea is to create on CRUD APIs of the entities the possibility to add the OnBefore and OnAfter actions to handle some scenario like audit every update/insert for example, another scenario could be to anonymize some sensitive data of a person detail after a getEntityName, etc.

The suggestion is to be something like the rest consume:



This comment was:
- originally posted on idea 'CRUD API - OnBefore and OnAfter Actions' (created on 07 Jul 2019 by Tiago Bojikian Costa Vital)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 08 Jul 2019 08:36:53 by Fernando Moitinho
Merged this idea with 'Generate CRUD wrapper when making an entity when making "Expose Read Only" to Yes' (created on 24 Jul 2019 05:51:59 by Amal Raj)
2018-12-29 03-19-43
Amal Raj
mvp_badge
MVP

Hello Team, 


It is a standard recommendation when creating entities in a module to make the entity read only and write CRUD wrappers to ensure,  modifications are done from a single point. 

It would be great if the OutSystems platform could scaffold these methods whenever an entity's "Expose Read Only" property is set to Yes. 

This will save a lot of time and accelerate development. 

Regards

Amal 



This comment was:
- originally posted on idea 'Generate CRUD wrapper when making an entity when making "Expose Read Only" to Yes' (created on 24 Jul 2019 by Amal Raj)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 24 Jul 2019 14:47:02 by Vasco Pessanha
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'CRUD Wrapper' (created on 12 Aug 2019 13:21:38 by Nuno Miguel Verdasca)

Hello everyone,

Like here, it's a good idea to wrap CRUD actions. Knowing this, I think it would be interesting, when we created an Entity, besides the CRUD actions could be done immediately the Wrapper of these same actions.

What do you think about this?


Best regards,

Nuno Verdasca



This comment was:
- originally posted on idea 'CRUD Wrapper' (created on 12 Aug 2019 by Nuno Miguel Verdasca)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 13 Aug 2019 11:26:08 by Justin James

+1

OK, many people are feeling the same pain..
I agree with the need for 90% of what is in here..
 

2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'CRUD creation automatically' (created on 21 Feb 2020 11:34:16 by Nuno Miguel Verdasca)

A topic that is often debated by many developers is why CRUDs are not created automatically, at least with a standard model, which can then be adjusted by Dev if necessary. I think this would be a great asset in terms of implementation.



This comment was:
- originally posted on idea 'CRUD creation automatically' (created on 21 Feb 2020 by Nuno Miguel Verdasca)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 23 Feb 2020 20:54:36 by Justin James

This is a great idea!


This feature could be done the same way the scaffolding actions are made. Drag and drop an entity in the folder "Server Actions" and it automatically creates default CRUD actions.

If the entity has the attributes "CreatedBy", "CreatedOn", "UpdatedBy" and "UpdatedOn", the scaffolding creates the logic to check if the record is new and it fills the values accordingly.

+1



This comment was:
- originally posted on idea 'CRUD creation automatically' (created on 21 Feb 2020 by Nuno Miguel Verdasca)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 23 Feb 2020 20:54:36 by Justin James

I agree with you Tiago, and about your sugest I have another ideia


https://www.outsystems.com/ideas/8113/creation-of-entities-with-versioning-attributes



This comment was:
- originally posted on idea 'CRUD creation automatically' (created on 21 Feb 2020 by Nuno Miguel Verdasca)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 23 Feb 2020 20:54:36 by Justin James
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Automatically create CRUD actions' (created on 13 Dec 2020 16:51:01 by Aureliano Pinheiro)

After creating an Entity and it´s attributes on the _CS Module automatically create the CRUD (Create, Read(Get), Update and Delete) actions in order for the user to turn them into public and be ready to use by other modules, this group of actions should be grouped into folders referring each Entity name.

Example for the FileHeader entity, the SoftDelete action is only if the Entity has the Is_Active(Boolean) attribute, turning it false for the record id on the input:




This comment was:
- originally posted on idea 'Automatically create CRUD actions' (created on 13 Dec 2020 by Aureliano Pinheiro)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 15 Dec 2020 09:06:52 by Daniël Kuhlmann

That could be usefull, and direct the developers to implement and use  CRUD action



This comment was:
- originally posted on idea 'Automatically create CRUD actions' (created on 13 Dec 2020 by Aureliano Pinheiro)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 15 Dec 2020 09:06:52 by Daniël Kuhlmann

Good idea, as this is one of the standard things you do for a new entity.



This comment was:
- originally posted on idea 'Automatically create CRUD actions' (created on 13 Dec 2020 by Aureliano Pinheiro)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 15 Dec 2020 09:06:52 by Daniël Kuhlmann
2019-11-12 17-31-26
Justin James
mvp_badge
MVP
Merged this idea with 'Include a "Create Action" option on Entity CRUD actions' (created on 19 Dec 2020 14:26:35 by José Gonçalves)

Like the option available in Local Storage to Create Action to Sync Data, Entities CRUD actions could have a similar option to create a server action for the selected operation. 

That server action could include the Id as input parameter for Delete and Get actions and the full record for Create and Update actions.



This comment was:
- originally posted on idea 'Include a "Create Action" option on Entity CRUD actions' (created on 19 Dec 2020 by José Gonçalves)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 21 Dec 2020 13:55:46 by Justin James

Example



This comment was:
- originally posted on idea 'Include a "Create Action" option on Entity CRUD actions' (created on 19 Dec 2020 by José Gonçalves)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 21 Dec 2020 13:55:46 by Justin James
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Create patterns that bootstrap default actions for entities' (created on 27 Jan 2021 10:14:53 by Remco Snijders)
2021-02-16 20-34-58
Remco Snijders
mvp_badge
MVP

We quite often use CreateOrUpdate actions for our new entities. These actions call a validation action, that returns IsValid and a ValidationMessage, they assemble a ValidationLog based on those messages, etc. and return a Success boolean and the ValidationLog.

For these kind of patterns that need to be implemented for every entity, it would be very useful to configure them once and then bootstrap the actions for every entity you create.



This comment was:
- originally posted on idea 'Create patterns that bootstrap default actions for entities' (created on 27 Jan 2021 by Remco Snijders)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 28 Jan 2021 05:34:01 by Daniël Kuhlmann

Kind of have a small RPA script in service studio. Like it!



This comment was:
- originally posted on idea 'Create patterns that bootstrap default actions for entities' (created on 27 Jan 2021 by Remco Snijders)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 28 Jan 2021 05:34:01 by Daniël Kuhlmann
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP

Great idea but already existing since 2011 with a lot of votes, and although it is on OutSystems Radar, but they say its not going to be implemented soon. Keep voting this idea!

I merge this idea in the original one.




This comment was:
- originally posted on idea 'Create patterns that bootstrap default actions for entities' (created on 27 Jan 2021 by Remco Snijders)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 28 Jan 2021 05:34:01 by Daniël Kuhlmann
2018-06-02 00-30-13
Carina
Champion

This really should be argued for more by the community. Let's keep it active.

Hi,

As all of you said, this is kind important for us! The effort that you put on it, creating the CRUD actions of each entity is massive.


As an architect, it will be timeless if this actions are created automatically.


Please guys, can you put it on your radar asap?


Kind Regards,

Nelson

2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Template Definition for CRUD Wrappers Automation' (created on 24 Dec 2019 17:00:48 by Spiros)

In order to speed up the development with OutSystems it will be great if we could define a template of how we like the core wrappers to be created on an application and then have a button that allows you to automatically create the wrapper by specifying some minimum information such as the related entity and operation to perform such as create, update, etc.


The template should allow for specifying any additional actions that are common across CRUD such as adding CreatedOn, CreatedBy, etc, calling audit actions that store information about the operation performed such log messages (ex. Record created), security checks, etc.


Without the above template definition/automation creating the CRUD in OutSystems results in more time than if you were to perform the CRUD wrappers using code. 



This comment was:
- originally posted on idea 'Template Definition for CRUD Wrappers Automation' (created on 24 Dec 2019 by Spiros)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 07 Feb 2021 10:00:10 by Daniël Kuhlmann
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP

Hi,

This idea already exists long time

https://www.outsystems.com/ideas/624/allow-redefining-entity-built-in-actions-crud-wrappers?IsFromAdvancedSearch=True

You better upvote that one, already 220 votes and counting.

Regards,

Daniel



This comment was:
- originally posted on idea 'Template Definition for CRUD Wrappers Automation' (created on 24 Dec 2019 by Spiros)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 07 Feb 2021 10:00:10 by Daniël Kuhlmann
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Accelerator for Entity Save Actions' (created on 05 Feb 2021 17:51:18 by Daniel Tavares)

When creating entities, for entites with the CreatedBy, CreationDate, LastChangedBy, LastChangedDate attributes, it would be helpful to quickly create a Save Action.


By selecting this option, a quick action could be implemented like in the following example.




The same option could be applied to an entity delete action.






This comment was:
- originally posted on idea 'Accelerator for Entity Save Actions' (created on 05 Feb 2021 by Daniel Tavares)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 07 Feb 2021 10:06:48 by Daniël Kuhlmann
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP

Good idea, and well written, but it exists already for over 10 years... and unfortunately OutSystems although 'Its on the radar"still does not take steps to implement this.

I will merge your idea into the other one.



This comment was:
- originally posted on idea 'Accelerator for Entity Save Actions' (created on 05 Feb 2021 by Daniel Tavares)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 07 Feb 2021 10:06:48 by Daniël Kuhlmann
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Dragging Entity Action to Server Action folder, Creating Wrapper' (created on 11 Feb 2021 23:35:20 by Pedro Lemos)

Hello everyone!

Dragging an Entity Action to the Server Actions folder could create an automated Wrapper Action.

What do you think?

Thank you!


(Example in Attachment Image.)



This comment was:
- originally posted on idea 'Dragging Entity Action to Server Action folder, Creating Wrapper' (created on 11 Feb 2021 by Pedro Lemos)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 12 Feb 2021 06:45:04 by Daniël Kuhlmann
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP

Hi Pedro,

It is a good idea, but it's similar to many of the same ideas that all relate to be able to automate the creation of CRUD wrappers. There for I merge like all the others, yours into the one original idea.

Kind regards,

Daniel



This comment was:
- originally posted on idea 'Dragging Entity Action to Server Action folder, Creating Wrapper' (created on 11 Feb 2021 by Pedro Lemos)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 12 Feb 2021 06:45:04 by Daniël Kuhlmann
Merged this idea with 'CRUD actions for read-only Entities' (created on 18 Mar 2021 11:47:29 by rodrigo henriques)

New feature that allows a user to automatically create all the CRUD actions for a specific Entity.


One of the issues in Architecture Dashboard is "Public Entities should be exposed as read-only". To correct we have to create the CRUD actions that some times is a very long and tedious task when we have multiple entites.


It would be nice if we had the possibility of:

- right click Entity

- generate CRUD actions


This would be specially useful when refactoring old applications.



This comment was:
- originally posted on idea 'CRUD actions for read-only Entities' (created on 18 Mar 2021 by rodrigo henriques)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 18 Mar 2021 12:21:50 by Vasco Pessanha
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Right-click entity and generate CRUD wrappers' (created on 16 Apr 2021 03:46:52 by Mitch Grant)

It would be great if we could select a number of entities and right click to auto-generate the CRUD wrapper server actions. Similar to the server actions created by the scaffolding.



This comment was:
- originally posted on idea 'Right-click entity and generate CRUD wrappers' (created on 16 Apr 2021 by Mitch Grant)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 16 Apr 2021 13:54:16 by Daniël Kuhlmann
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Boilerplate API for entities to encapsulate CRUD operation' (created on 29 May 2021 11:19:59 by varunsingh8780)

When we add entities, CRUD operations are automatically created by Outsystems. However, it is not suggested to directly consume those CRUD operation in component (by making them public). It will be useful to also generate service action bolierplate (with public access) for consumption in other components. This will help enforce best practice and developer will not try to make CRUD operation public for any reason.



This comment was:
- originally posted on idea 'Boilerplate API for entities to encapsulate CRUD operation' (created on 29 May 2021 by varunsingh8780)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 30 May 2021 08:37:28 by Daniël Kuhlmann
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Option to auto generate Server Actions that encapsulate CRUD actions' (created on 21 Jul 2021 07:04:44 by Sobi PILLAI)

There should be an option in Entities to auto generate the Server Actions that encapsulates the CRUD actions which should will be stored in

 Logic => Server Actions => {Folder: Entity_name} => ...

Image attached




This comment was:
- originally posted on idea 'Option to auto generate Server Actions that encapsulate CRUD actions' (created on 21 Jul 2021 by Sobi PILLAI)
- merged to idea 'Allow redefining entity built-in actions (CRUD Wrappers)' on 22 Jul 2021 07:18:26 by Daniël Kuhlmann

This is really a great idea, as this will reduce the effort of creating the wrappers on each entity and will also ensure the best practice is getting followed.

Even in warnings we can show if any entity action is getting used directly of the same module.

Thanks,

Preeti Kumari

2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'option to create CRUD operations' (created on 17 Dec 2021 08:09:26 by Navaneethan M)

when we make "Expose Read only" as TRUE for Entities, we have to create APIs for the CRUD operations. it will consume some, and if we have so many entities this CRUD API creation will take Considerable developers effort.

Create a option to generate a CRUD APIs by a single click



_Navaneethan


2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Entities - CRUD actions' (created on 01 Aug 2021 17:47:57 by Alexandrino Galveia)

To be possible to create CRUD actions automatically:

  • Save (Create or Update)
  • Soft Delete (Only change the IsActive flag)
  • Harde Delete (Delete the record)
2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP

Hi,

Save (CreateOrUpdate) and HardDelete (Delete) already exist, so really you only ask for the SoftDelete as a new CRUD action.

Regards,

Daniel

2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP
Merged this idea with 'Create CRUD wrappers when 'Expose Read Only'' (created on 12 May 2022 09:22:00 by Jorick van Rijs)

When setting an entity 'Expose Read Only' to Yes; automatically(or triggered by a checkbox in entity properties) create basic crud wrappers for that entity in the Logic folder. 

I would disagree. Let's assume we have created 20 entities, So you are saying that OutSystems should create 80 Server actions automatically. Don't you think it will make your architecture really messy? It hardly takes around 20 seconds to create a CRUD wrapper.

2020-04-15 12-37-36
Daniël Kuhlmann
mvp_badge
MVP

It is a good idea to have this as an option, I guess creating a CRUD wrapper is one of the most boring things one can do, and I never managed to do it in 20 seconds. But I merge this in one of the oldest ideas on the forum.