195
Views
3
Comments
Solved
Add Amenities to Hotel Room - Booking Assignment (# 5)
Question

Hi, 

 I'm on Assignment 5 of Hotel Bookings where I have to add Amenities to Hotel Rooms. I need some help figuring out my problem where I'm adding 3 Amenities to suppose room "101" but the same list is reflecting in All the rooms. I have only assigned the roomId of the form to the roomId (input parameter) in assign of the save( which is used to create or update room entity). I really am confused at this point and would love someone to point me in the right direction. I can attach my file for you to check. Thanks in advance.

Bookings_AJ.oml
2020-02-28 09-46-54
Eduardo Jauch
Solution

Hi Akii

Without looking to your code (don't have an SS here with me), I would say that the problem is in the aggregate feeding the Table Records that shows the ammenities for a room in the RoomDetail screen. 

In the aggregate, you must fetch the RoomAmmenity entity (don't remember if this is the name), and join with the Ammenity static entity (to get the ammenity name). 

But you need to filter it by the RoomId.

RoomAmmenity.RoomId = RoomId

Otherwise, it will show all ammenities.

Not sure if this is the problem, but it seems this to me.

Hope this helps.

Cheers.

2019-05-22 11-30-09
Marcelo Ferreira

Hi Akii,

On RoomDetail page preparation you have this agreggate GetRoomAmenities. Instead of the filter you are using 

"RoomAmenity.AmenityId = Amenity.Id" use what Eduardo suggested "RoomAmmenity.RoomId = RoomId"

Regards,

Marcelo 



UserImage.jpg
Akii J

Hi,

Thanks a lot for your quick response. It worked & you made me realize what I was doing wrong. I was filtering it as

RoomAmmenity.RoomId = Room.Id instead of RoomAmmenity.RoomId = RoomId so it created the same instances in every room. Thanks a lot though! :)

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.