Automatic generation of fields and actions

On our radar

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.
Created on 4 Jun
Comments (18)
Merged this idea with 'Standard "Created/Changed On/By" attributes for entities' (created on 19 Dec 2014 14:04:15 by Erdal Yalcin)
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.

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

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)

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" 

Changed the category to Backend

Changed the status to
On 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?


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?

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?

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

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)

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.

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.

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.

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.

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.

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

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.