Entity/Structure actions


In OOP you have classes which contain attributes and functions, so called Objects.

In Outsystems we have Entities and Structures, which can hold attributes, but not actions.

Example, I have an object called Person:

- FirstName (string)
- LastName (string)
- DateOfBirth (timestamp/long integer)
- Gender (char)

And I have a function defined as 

Function FormatName{
    return this.FirstName + " " + this.LastName;

In Outsystems you would do this on an aggregate, with a calculated attribute, but what if I have a structure (or an empty entity record which I fill in a create page), at that point I don't have access to calculated attributes and I would dislike to retype `Person.FirstName + " " + Person.LastName` every time.

So ofcourse I would create an action, which takes as input a Person structure/entity and returns the desired output.

Frankly I can have alot of these actions, for all sorts of things, but in big modules I easily lose track of where my actions are located (sure I can use folders, for every entity I create). 

I would love for these actions to be placed at the Data tab, within my entity details and I prefer for these actions to be accessed by PersonRecord.FormatName()

Created on 19 Oct 2018
Comments (1)

Changed the category to Backend