342
Views
3
Comments
Solved
[WUYXEV039].DBO.[OSUSR_PPV_ROOM] with key 0 was not found Error
Question

Hi Guys,

I'm currently working my way through a Hotel Bookings assignment as I've completed most of the guided path tasks but this one holds your hand a lot less. Which is a good way to carry on my learning.

link to task below: 

https://www.outsystems.com/learn/courses/15/developing-outsystems-web-applications/

I'm currently at a part in the documentation in where I need to pull available rooms which co-inside with the data the user has input. 


I believed I done everything correct but as you can see with the included error, when I click on my version of get Available rooms I get the error in the title.

[WUYXEV039].DBO.[OSUSR_PPV_ROOM] with key 0 was not found

I've included a screen shot of my SQL with the parameters as well as the preparation in the screenshot.

As somewhere along the lines within there I think i may have messed up. Maybe not using the correct procedure or something?
I am still in the process of learning and the documentation doesn't hold your hand as much as the previous ones so I'm bound to slip up somewhere.


If there's anything else you need me to include in the post please let me know. Any help would be amazing. 

Thanks! :)


EDIT. Here's the error in the browser.


2026-06-05 12-38-17
Eduardo Jauch
Solution

Hello Aaron, 

The most common cause for this message is the use of a Get entity action in an expression in the screen without the ID. 

For example, if you are using the GetRoom entity action in the expression in the form to show room number and price, but is failing to pass the Id to it, it would give you this error message when clicking Get Available Room. 

Suggestion on this screen. 

1. In the aggregate in preparation join the Room entity to the Booking entity. This will make the Room entity available in the form. 

2. In the Form expression to show the Room number and price, fetch this information from the form Record (Room entity, now available). 

3. In the Get Available Room, after the query, use an assign to store the room Id in the form Record Booking entity and the Room number and price in the Form record Room entity (because it is from it that the expression will fetch the data). 

This way the room number and price will be available both when you click the Get Available Room as well as when you navigate to this screen from the Bookings List page, to edit/see an existing booking. 

Also, if the SQL does not return nothing because the parameters are not defined or there is no room available, you don't get any error. 

Hope this helps. 

Cheers. 

2016-04-22 00-29-45
Nuno Reis
 
MVP

That message of key = 0 means that you haven't passed on the id. On this case, Room.id.

Could it be that you are not using the right query?

Check the action called by the button and the ID it passes on.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi Aarron,


it would be easiest if you would attach the oml of your project to the post.  

It looks to me like maybe instead of just doing an ajax submit and only refreshing the proposed room in the screen, you are actually submitting the form, which might be followed by the preparation of your form. 

 I'm thinking that because all your form fields are empty on the screen print, that probably isn't the intended behaviour when users choose the 'Get Available Room' button.

2026-06-05 12-38-17
Eduardo Jauch
Solution

Hello Aaron, 

The most common cause for this message is the use of a Get entity action in an expression in the screen without the ID. 

For example, if you are using the GetRoom entity action in the expression in the form to show room number and price, but is failing to pass the Id to it, it would give you this error message when clicking Get Available Room. 

Suggestion on this screen. 

1. In the aggregate in preparation join the Room entity to the Booking entity. This will make the Room entity available in the form. 

2. In the Form expression to show the Room number and price, fetch this information from the form Record (Room entity, now available). 

3. In the Get Available Room, after the query, use an assign to store the room Id in the form Record Booking entity and the Room number and price in the Form record Room entity (because it is from it that the expression will fetch the data). 

This way the room number and price will be available both when you click the Get Available Room as well as when you navigate to this screen from the Bookings List page, to edit/see an existing booking. 

Also, if the SQL does not return nothing because the parameters are not defined or there is no room available, you don't get any error. 

Hope this helps. 

Cheers. 

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