Implementing Validation for Entity Naming Conventions in Our Tree Application

In our Tree application, it’s essential to adhere to a specific naming convention for entities, which is: [digits]-[project name]. This convention facilitates organization and ensures consistency across various parts of the application where these entity names are referenced.

I aim to introduce a validation mechanism for entity names entered by users. If a name does not comply with our established format, the application should display an informative message to guide the user towards the correct format.

Could you advise if there’s an existing feature or method within VIKTOR to support this validation process?

I appreciate any insights or suggestions on how to implement this feature effectively.

Hi Karam,

That’s an interesting question. As far as I am aware there currently is no functionality to enforce a certain naming convention on entity creation.

I’ll create a new issue in our internal issue tracker for this feature and re-tag this topic as a Feature Request so we can keep everybody up-to-date on the progress.

In the meantime:
A workaround could be to use the API in the SDK to check for names once the entity is created. Using the rename method you could even automatically rename the entity itself.

1 Like