Mendix Validation Check with existing record

42 views Asked by At

Currently I'm working on a project which related to an entity which is Shift and the attributes are ID, Name and Description. I will require to add, edit and delete the shift record. May I know how is the validation logic performed in microflow to compare with existing record in database, and show the record is already existed if the record is existed?

1

There are 1 answers

0
ElineBijkerk On BEST ANSWER

You need to find out for yourself which of these attributes, or a combination of those, is unique. Since you have a shift ID, it sounds like this one is unique. Do a retrieve from database on ID = $Shift/ID. If the database retrieve works and retrieves a shift, it already exists in the database and you can show a warning. If the retrieve's result is empty, you know it didn't exist yet.