91
Views
13
Comments
Solved
No Rooms Available Message - Hotel Booking
Application Type
Reactive

Hello,


I'm working on the Hotel Booking APP.

When you click 'Get Available Room' button and there is no vacancy, I want to display the message saying 'No rooms available'. But it doesn't work. Nothing is displayed.


Is the condition incorrect?

If there are vacancies, the cheapest room is properly displayed.


Please some help.

Thanks.



HotelBooking.oap
UserImage.jpg
Sarah38
Solution

Hi, All


I've remade my oap file and found my misteke.

The If condition is correct, but I set a value in the visible property of the container and completely forgot.

I'm so embarrassed and sorry to bother you guys..

After changing the property to "GetAvailableRoom.IsGetAvailableRoomClicked = True",  the message saying 'No rooms available'  displays correctly.


Thank you for the help.

UserImage.jpg
Kay Lun

Hello Sarah,

good to hear that, so my guessing is correct haha, grad that you have solved the problem.

Cheers.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

For some reason I cannot open the OML, it gives IPP error, which is strange, as files uploaded here should have IPP removed.

Could you share the part where you have the message defined in the IF

Regards,

Daniel

UserImage.jpg
Sarah38

Thanks for taking a look at my post.


I uploaded some images. Is this okay? 

Please let me know if there is any other information you need.


Sarah

If_Condition.png
Aggregate_GetBookingById.png
UserImage.jpg
Sarah38
Logic_GetAvailableRoomOnClick.png
DataAction_GetAvailableRoom.png
2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

This is what I asked for in my previous reply:

Could you share the part where you have the message "No rooms available" defined in the IF 


UserImage.jpg
Kay Lun

Hi Sarah,

I can't open your oap file either, but according to the screenshots you have, your expression condition should change to GetAvailableRoom.Room.Id = NullIdentifier() instead, cuz you are trying to get the available room by the data action, and when there's no room available, the GetAvailableRoom.Room.Id should return null.

Hope this could help.

UserImage.jpg
Sarah38

Hello, Kay

Thank you for your help, but it doesn't work either.


When debugging, A returns 0, so  I changed the expression condition to 'GetAvailableRoom.Room.Id = 0 ',  it doesn't work either..



UserImage.jpg
Kay Lun

Hi sarah,

I think you're looking at the wrong data when debugging, when the breakpoint stop at the assign, at that moment, the assign is not done yet, you should check the return list from the SQL, which expand the list should be the right data select by the query.


If you look into the Room variable, your breakpoint need to stop at the END Node instead


Hope this help

UserImage.jpg
Kay Lun

I have done this exercise before, although the way how I implement the available room is different compare to yours one, but still, let me share mine one to you, so you could get an idea of how it works.

p.s. In my files, there might be something which is not related, you could just ignore them.

The file is bigger than 4MBs, so I uploaded to my GDrive, you could download from there and use it as a reference if needed :)

https://drive.google.com/file/d/1jbzUxONzUGBTyFktBWWN2TohA2GIlhEW/view?usp=drivesdk

UserImage.jpg
Sarah38

Thank you.

I tried to download your file, but I can't because of  IPP error.

Anyway, I'll try to remove IPP from my oap file. probably I'll remake it and upload again.

Please help me later.


2025-10-18 11-13-53
Ramesh subramanian

Hi Sarah, 

did you correctly do GetAvailableRoom Adv SQL?

Please find the attached sample file.


Thanks,

Ramesh

Bookings.oml
UserImage.jpg
Sarah38

Thanks Ramesh


I checked the SQL again and it seems to be fine.

I'll try to remove IPP from my oap file and upload again. 

UserImage.jpg
Sarah38
Solution

Hi, All


I've remade my oap file and found my misteke.

The If condition is correct, but I set a value in the visible property of the container and completely forgot.

I'm so embarrassed and sorry to bother you guys..

After changing the property to "GetAvailableRoom.IsGetAvailableRoomClicked = True",  the message saying 'No rooms available'  displays correctly.


Thank you for the help.

UserImage.jpg
Kay Lun

Hello Sarah,

good to hear that, so my guessing is correct haha, grad that you have solved the problem.

Cheers.

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