Can I check if my form is in New or Edit Mode?

5
Hi All! I have a blaNewEdit form in my Mendix-app. In this form I'd like to to make visible a boolean attribute, only when a record is _edited and not when a new record is created. I know I can make 2 forms (1 for the New-button and 1 for the Edit button) but for maintenance I want to avoid this option. I thought about Conditional surpressing this field (or the table-row of this field). The question then would be If I can detect that this form is in New or Edit mode. Is this possible? Or are there smart alternatives? Thanks in forward for your answers! Roberto [the field I want to use it for is a checkbox that indicates whether a notification is processed or not. When a new notification is made, I want to avoid that users can set this notification on "processed" initially (this should be done when the record is updated)]
asked
2 answers
4

You can add a boolean virtual attribute to your entity, which returns isNew($object). You can use that attribute in combination with conditional visibility to show or hide stuff.

answered
1

Super cool, that works fine! Thanks!

answered