Skip to main content

DatalessRecordContainer

A DatalessRecordContainer makes it possible to use an Entity without loading or writing persistent data through the RecordContainer. This is useful for pure input scenarios where the entered data is only needed temporarily and is processed immediately afterwards.

Example usage

If you want to request specific information before opening the actual Context, you can use an Entity with a DatalessRecordContainer. Via an Action, the information can subsequently be extracted from the EntityFields and then passed to another Entity via method neon.openContextWithRecipe, using a Parameter.

Examples in ADITO xRM

There are several examples of DatalessRecordContainer usage in the ADITO xRM project. You can find them by searching for the term datalessRecordContainer.

An easy-to-understand example is BulkMailTesting_entity in module bulkmail. This Entity's View BulkMailTesting_view is opened when, in the FilterView of Context BulkMail, a dataset is selected and Action Test email is called via the three-dotted button in the CardViewTemplate of the PreviewView. See BulkMail_entity.testMail.onActionProcess.

BulkMailTesting_view is only required for selecting a contact and entering the recipient email address. Both values are temporary data that does not need to be stored anywhere. After the user has pressed the button Test email, the data is extracted in process BulkMailTesting_entity.testMail.onActionProcess and used for sending the test email.

If the user has set the switch Save settings to true, then CONTACT_ID and the email recipient are stored in the database table BULKMAIL, which refers to BulkMail_entity in module bulkmail. BulkMailTesting_entity itself does not need database access and therefore uses a DatalessRecordContainer.

note

A DatalessRecordContainer also has the property alias for specifying the default alias, even though there is no database access in this case. The reason is consistency: alias must be a common property of all RecordContainer types. This is required because a RecordContainer with an alias property is a prerequisite for all methods that allow database access on Entity level, for example in Actions.

note

If you open the PreviewView of an Entity connected to a DatalessRecordContainer, and there is an Action involved that does not cause a jump to another Entity, close the PreviewView at the end of onActionProcess:

neon.closeImage(vars.get("$sys.currentimage"), true);

Otherwise, the PreviewView remains open. The user does not get feedback when the Action is finished and must close the window manually.