259
Views
5
Comments
Solved
5.3 Add Amenities to Hotel Rooms (Booking Assignment)
Application Type
Traditional Web
Service Studio Version
11.14.1 (Build 54682)

Hi,
I'm just starting with Outsystems and I am currently still working about booking assignment. I've successfully implemented adding room amenities to an existing room. the question is how after I select for example "television" then press the "save & new" button and the screen refreshes and then deletes it from the combo box list. 

so when pressing the "save & new" button, the screen remains in the room amenities. and when pressing the "save" button the screen will lead to the detail room. In other words, once it is selected for a particular room, it will not appear in the list of available amenity either at this time. It will still be available for other rooms to choose from, only it won't show again for the same room.

I included my oml file for convenience.

Thanks so much in advance for any help.

Pais Maulana


Bookingspm.oml
2018-10-18 08-34-00
Eric Bulters
 
MVP
Solution

Hi Pais,

You'll want to have an aggregate in your preparation for your dropdown where you filter out the amenities already in the room.

and then on your save action you refresh the aggregate and the webblock the dropdown is in (give the container a name so you can reference it in the ajax refresh)


UserImage.jpg
Pais Maulana

I'm sorry sir, how to filter out amenities that already in the room in aggregate? i don't get it

2018-10-18 08-34-00
Eric Bulters
 
MVP

Hi Pais,

in the preparation of your screen create an aggregate for the dropdown using the amenities entity and the room entity.
Set the Join to With or Without and make sure it joins using 

Amnity.Id = Room.AmnityId and Room.Id = RoomId



now in your filter add: 

Room.Id = Nullidentifier()



UserImage.jpg
Pais Maulana
2018-10-18 08-34-00
Eric Bulters
 
MVP
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.