can someone help to maka a functionality.

hii members  i am new in mendix. i have a domain model with three entities  Booking  Room  Status (with attribute Status Enum – CheckedIn , CheckedOut, Cancel , Booked) Now i have to Make Booking_NewEdit Page  my Booking Entity is associated with status and Room with 1-1 association  is this association is right  i thought that one booking can have one room  and one status at a time  in booking entity i have checkedInDate CheckedOUt Date and Children and adult capacity attribute  and Room also have children and adult capacity attribute. so i want when i fill the children and adult number and checkedIn date and CheckedOutDate while booking a room on Booking NewEdit page there should be fetched a available room below to form and then i select a room to book    can some one guide me step by step    my domain model    i want to achieve like below image  is there any need to update domain model also  please suggest me.
2 answers

Hello again


I read your comment

What you can do is adding a boolean attribute called “isBooked” to your room entity and have the default value as false.


Then in the same xpath constrain you can check for it like

[AdultsCapacity >= $Booking/NumberOfAdults
ChildrenCapacity >= $Booking/NumberOfChildren
and isBooked = false()]


Then make a custom save functionality using a microflow

And call it as the on click action instead of the default save button

In this newly created micro flow

Add a change object activity to change the Room object and set its “isBooked” to true


Hello Sanjay,


Your domain model looks fine


But first you need to have Room objects ready

So create some rooms with capacities and all


Then in your New Booking page:


Add a reference selector widget to select a room
in the properties of the reference selector
go to the Selectable objects tab and use the xpath constrains, similar to


[AdultsCapacity >= $Booking/NumberOfAdults
ChildrenCapacity >= $Booking/NumberOfChildren]


*Use Ctrl+Space to help you with xpath