Is new entity

The behaviour type Is new entity examines the element data of the executing element to determine whether it refers to a 'new' – i.e. previously unsaved – instance of an entity. The entity in question can be a business object (see Shipments, Orders, Manifests, Common business object), a line item of a business object, a configuration object or a master data object.

Within a form, several entities of different types are often in a hierarchical relationship. A business object can contain line items and often uses typed attributes to refer to addresses or company accounts, which in turn use addresses. Starting from the executing element, the behaviour type Is new entity always refers to the nearest parent entity.

For Input forms, there is at least a reference to the entity that provides the form data. Portals and Dashboard, on the other hand, are by definition not bound to any entity, but can contain data from entities, for example, if an entry form is embedded (see Embed forms (Sub-forms)) or when data from an entity has been set for an Element containers using Populate element data.

Only if the executing element fulfills all of the following conditions are the Actions on 'false' executed, since a data object that is 'not new' was detected:

  • The element data are directly or indirectly related to an entity.

  • The identified entity has a long value other than 0 in the ID (id) field.

NOTE◄ Whether the entity actually exists on the server side is not the subject of the check. Only the form data available at the client is evaluated.

Conversely, the Actions on 'true' are executed if one of these conditions is not met, i.e. either no reference to an entity exists (e.g. in a portal) or an entity has been detected to which no ID (id) has yet been assigned (default value 0).

The behaviour type does not expect any input data ($input) and passes this data directly to the respective actions if necessary.

Examples

Within the same entry form for Shipments, the behaviour type Is new entity should be used to demonstrate two different entities:

  1. At header level ('Shipment'), it should be ensured that the required header data (required fields) have been filled in and saved before line item data can be edited.

  2. When editing line items, any line items added since the shipment was last saved should be marked with a suitable symbol (images/download/attachments/189432132/image2020-5-25_17-29-19-version-1-modificationdate-1727769117762-api-v2.png ).

Runtime examples:

images/download/attachments/189432132/image2020-5-26_10-37-48-version-1-modificationdate-1727769117790-api-v2.png

  • When creating a new shipment, only an inactive 'placeholder' appears for the line items.

Once the header data has been filled in, access to line items (see below) can be obtained by 'saving' and the note in the label disappears:

images/download/attachments/189432132/image2020-5-26_10-40-43-version-1-modificationdate-1727769117792-api-v2.png

If the shipment is saved after entering the first line item, the symbol (images/download/attachments/189432132/image2020-5-25_17-29-19-version-1-modificationdate-1727769117762-api-v2.png ) for the first row disappears and the newly added item can be distinguished:

images/download/attachments/189432132/image2020-5-26_10-43-29-version-1-modificationdate-1727769117795-api-v2.png

Configuration:

images/download/attachments/189432132/image-2024-10-1_10-12-49-version-1-modificationdate-1727770370072-api-v2.png

A behaviour is configured for the form element, as shown on the left:

  • The Triggering event Form data loaded becomes active when loading data into the form.


  • The Behaviour type Is new entity can then check whether – e.g. by clicking the ribbon button 'New' or 'Copy', a new entity of the 'Shipment' type has been made available.


  • Via the Actions on 'true', access to the line items is blocked for a new shipment object via the Disable element action. Conversely, the Show element action reveals a Label element that indicates the reason for being blocked (see above).


  • If the shipment object has been saved, which is only possible after all active mandatory fields have been filled in, then the Actions on 'false' work inversely: An Enable element action allows the creation of line items, and the Label with the hint is hidden by the Hide element.

images/download/attachments/189432132/image-2024-10-1_10-16-7-version-1-modificationdate-1727770567369-api-v2.png

The behaviour shown on the left has been configured for the text field 'Line item no.' (see above) in the Repeatable element container for the 'Line items'. Therefore, the respective shipment line item is the essential entity for the behaviour type:

  • The Triggering event Form data loaded is active at line item level not only when the form data is loaded, but also when each additional row is added.


  • The Behaviour type Is new entity checks each displayed item with respect to the id only visible in the data.


  • Via the Actions on 'true', the Image/Icon linked as a Target element is set to visible for a newly recognized item with the Show element action.


  • Via the Actions on 'false', the Image/Icon linked as a Target element is set to invisible for an already saved position with the Hide element action.

NOTE◄ It is not possible to see whether a previously saved position has been changed.