non-persistable entities are used to model data that doesn't need to be stored in the database but can be used within the client application during runtime. To store data temporarily on the client side using a non-persistable entity, you can follow these steps:
-
Create a Non-Persistable Entity:
- Go to the domain model in Mendix.
- Create a new entity and uncheck the "Persistable" option in the entity properties.
- Add attributes to this entity to represent the data you want to store temporarily.
-
Use Microflows or Nanoflows:
- To populate this non-persistable entity with data, you can use microflows or nanoflows within your Mendix application.
- You can create microflows to create instances of this non-persistable entity, set attribute values, and use them within the client application logic.
-
Client-Side Data Manipulation:
- Non-persistable entities are primarily used for client-side operations, meaning you can manipulate the data within the client application during runtime.
- You can display, update, and perform calculations using the data stored in these non-persistable entities in your app's pages or forms.
-
Data Lifespan:
- It's important to note that non-persistable entities exist only during the runtime of the Mendix application.
- Once the session ends (for example, when the user logs out or closes the application), the data stored in the non-persistable entities will be lost.
-
Clearing Non-Persistable Entity Data:
- To clear the data stored in a non-persistable entity, you can use microflows or nanoflows to delete the instances or reset their attribute values.