Base solution for your next web application
Open Closed

Predefined values for entities #11910


User avatar
0
Ojala7 created

Hi,

How do I add predefined values for entities when a new tenant is created?

Thanks


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @Ojala7

    Could you provide a bit more detail about what you want ? Do you want to create specific entities when a tenant is created or do you want to assign a default value to an entity field ?

  • User Avatar
    0
    Ojala7 created

    Hi, I want to create an entity which a field status. The field status has to be an entity on its own right. The values in status would be, by default draft, pending, final. I have noticed when a new tenant is created the status values are empty for the newly created tenant. I want these values to be draft, pending, final. What's more the status must be multi lingual

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    For this case, I think you can create status field as enum and set its default value in the constructor of the entity. For more complex cases, I suggest you to create a doman service, create main entity and related entity in this class and set the relation.

  • User Avatar
    0
    Ojala7 created

    Thanks