Event on creation of an entity

0
Does Mendix provide some event on creation af an Entity in the Domain-model?Like many companies we have some structure that we use in the App Explorer in Mendix Studio.For every entity we create we need to create a sub-directory in the Object- and in the UI-directory to put the needed pages/microflows/... for that EntityIt would be handy that these are created automatically on creation of the entity in the domain-model.I know that sometimes this will not be needed (so we have empty directories - needs to be deleted on commit) but most of the time we will need those.So now I'm wondering is there is some possibility in Mendix to do something like this
asked
2 answers
0

We are already following the template/module copy approach. We prepare the required folder structure, pages, and microflows once, and then duplicate them whenever a new entity is created. This helps us maintain consistency and avoids dealing with empty or missing folders.


If you are looking for further automation, it might be possible to build a custom Studio Pro Extension to create the folders automatically when needed. However, this would require developing and maintaining a plugin, so it may take some time and effort.


The best long-term solution would be to submit this as a feature request in the Mendix Ideas portal. The Mendix product team actively reviews Ideas there, and this kind of developer productivity improvement could be considered for future Studio Pro enhancements.


answered
0

hi,


No Mendix does not provide a design-time event or hook that triggers when an entity is created in the Domain Model.

There is no built-in mechanism in Studio Pro to automatically create folders, pages, or microflows when a new entity is added.

Why

Domain model changes happen at design time, and Mendix does not expose extension points or scripting hooks for Studio Pro to react to entity creation.

Event handlers (Before/After Create) only apply to runtime object creation, not when defining entities in the model.

What You Can Do

If you want automation, the supported options are:

  1. Create a custom module template
  2. Pre-structure your module with folders like:

Objects/
UI/
Microflows/
  1. Then duplicate the structure when needed.
  2. Use Team conventions + code review
  3. Enforce folder creation as part of your development standards.
  4. External tooling (advanced)
  5. Some teams use external scripts (e.g., PowerShell/Git hooks) to create folder structures after model changes — but this is outside Mendix support.

There is currently no supported way in Mendix Studio Pro to auto-create directories on entity creation. This would require a Studio Pro extension feature, which does not exist today.

answered