Disable Input in Edit Page

0
Hi, I am new to Mendix.  And I would like to know how to disable an input field in Edit Page but it will be enable in Create Page. Currently, I am using this method, but it is not the best. I am hoping to be able to read some kind of id field of the object to indicate whether it is existing object or new object.   Can anyone help of how to do it the Mendix way?
asked
2 answers
0

Hi Yudi,

You may want to look at the isNew()-function: https://docs.mendix.com/refguide/special-checks#4-checking-whether-an-object-is-new-a-name-new-a 

answered
0

You could

  • add an attribute to the entity called CommittedToDatabase with a default value of false. 
  • Then, create a microflow that sets this value to true
  • Set this microflow as an after commit event handler on the entity
  • Use the CommittedToDatabase attribute to control editability of the Name field (if it is false, the field is editable, if true, not editable)

Hope that helps

answered