How to use non Persistable Entity to store data towards client?

0
How to use non Persistable Entity to store data towards client?
asked
3 answers
1

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
answered
0

Nanoflow Commons contains actions that can be used to store NPEs in Browser local storage.

 

https://docs.mendix.com/appstore/modules/nanoflow-commons/

answered
-1

See the documentation here: https://docs.mendix.com/refguide/persistability

Non persistent objects only live client side but can be really handy to store temporary objects.

Regards,

Ronald

 

answered