To create a new record for an entity in your eSpace, you can either use the Create<Entity name> action or the CreateOrUpdate<Entity name> action.
If the entity has no primary key, the CreateOrUpdate<Entity name> action is not available and you can only use the Create<Entity name> action.
Source: Record with the definition of the entity . The Source argument must be a Record that contains the definition of the Entity.
To create this record you can do one of the following:
If you are gathering the entity information from an edit record widget, simply use the Record runtime property of that widget. See more about Record widgets runtime properties.
You can create a local variable of the Record type that contains the entity definition and assign to each attribute of this record the suitable values.
If there are attributes of the record that don't have values assigned, the corresponding null values are used.
Id: Identifier for the record created. The Id argument is of type <Entity> Identifier.
See how to access the output parameters.
The function creates a new record or updates an existing one, depending on the value of the Identifier in the Source record:
If the Identifier corresponds to an entity record that already exists, then this function updates the row in the physical table that corresponds to the Identifier.
Otherwise, this function inserts a new row in the physical table as specified in the Source record. Note that if the entity Identifier is an Auto Number, then the value you specified in the Source is ignored and the Identifier for the new record is determined sequentially by the OutSystems Platform
A database exception might be raised when, for example you have a reference attribute that does exist in the database, the value assigned to the entity attribute does not fit the size of the database column, etc.
Execute an Entity Action | Create Entities | Update Entities | Delete Entities | Get Entities | Handle Exceptions