How to make the entity attribute as NOT NULL column in database

0
Hi Team, Let us assume we created a new entity Customer (CID, Name, Mobile), when the entity created in SQL Server database, the property NULL will be checked, how can we enforce Mendix to create the column as NOT NULL in the database
asked
5 answers
1

Hi Ismail,

 

Try implementing Event Handler check validation before commit activity.

 

Hope it helps!

Thanks & Regards,

Manikandan K

answered
1

Ismail,

In Mendix, you cannot directly alter the tables in the database.  As far as I know, there is not a setting in Studio Pro that will result in NOT NULL being added in the database schema.

Mike

answered
0

Hi Ismail,

Their is a Validation rules tab in Entity Properties. Choose the attribute you wanted, and set the rule as 'Required', that will resolve your issue.

answered
0

Hi Ismail,

Go to domain model > double click > go to validation rule tab > select your attribute as required and give the error message.

 

Screenshot 2024-10-24 112623.png

answered
0

Currently it's not possible to have a database contraint to validate NULL or NOT NULL. Mendix only creates database constraints for unique columns, all other entity validation rules are handled by the Mendix runtime.  I will add it to the wishlist.

answered