Hi,

I've made Check In, Check Out and Cancel Bookings. but I got something weird when I click the button Check Out it showed the first list of booking not that I choose. Where is the problem here?

check this video: https://drive.google.com/file/d/12UdkNwit0YhieJzi9b6Xb6zJLwbsgBMZ/view?usp=sharing

This is the ConfirmCheckOut action:                                                                                             


*When the button Check Out is pressed should display ConfirmationScreen that contains booking detail and when the button Cancel pressed in ConfirmationScreen should link to DetailScreen not New Booking. 

Sorry for my little knowledge about outsystem.

Thanks

Hi,

At the end of the action, you are navigating (through the Destination statement) to the Bookings page.

If you want to go to the Confirmation page, you should change the destination for the Confirmation page.

P.S: The video is protected.

Cheers

Eduardo Jauch wrote:

Hi,

At the end of the action, you are navigating (through the Destination statement) to the Bookings page.

If you want to go to the Confirmation page, you should change the destination for the Confirmation page.

P.S: The video is protected.

Cheers

Hello Eduardo.

Thanks for the reply, I already set at the end of the action to Web Screen page. 

This is my problem: https://drive.google.com/file/d/12UdkNwit0YhieJzi9b6Xb6zJLwbsgBMZ/view?usp=sharing


Hi, 

Now I can see.

Regarding the CANCEL button, you must set it to navigate back to details, as you are doing, but you need to set correctly the BookingId (the Confirmation screen has an input parameter BookingId that you can use).

Regarding the error.
What are you passing to the ChangeStatus action, and why you have an UpdateBooking action after it (and what are you passing to it)?

Cheers.

Eduardo Jauch wrote:

Hi, 

Now I can see.

Regarding the CANCEL button, you must set it to navigate back to details, as you are doing, but you need to set correctly the BookingId (the Confirmation screen has an input parameter BookingId that you can use).

Regarding the error.
What are you passing to the ChangeStatus action, and why you have an UpdateBooking action after it (and what are you passing to it)?

Cheers.

Regarding the Cancel button, I already set input parameter BookingId = NullIdentifier()


Regarding the error,

the screenshot before that is for Confirm Check Out button(

I'm using ChangeStatus logic for change status at list booking and update it), 

This is the Check Out button action that navigate to Confirmation Page


Hi Ayu, 

1. If you set the cancel button link to BookingDetail and set the BookingId input parameter to NullIdentifier, you are saying that you want to open the BookingDetail page to create a new Booking. 

What you want is to go back to the Booking you were seeing before. 

The confirmation page must have an input parameter called BookingId, right? 

So set the value of the BookingId parameter in the button to be the ButtonId input parameter of the page. It should be like this:

ButtonId = ButtonId

2. In the following action:

You first go fetch the booking by its Id. 

Than you are changing the status of this record in memory (the assignment). 

Then you are calling ChangeStatus. First question here: what are you passing to this action? 

Than you are calling Update oolong. Second question: what are you providing as the source record for this entity action? 

Third question: why are you using both ChangeStatus and Update Booking? 

Eduardo Jauch wrote:

Hi Ayu, 

1. If you set the cancel button link to BookingDetail and set the BookingId input parameter to NullIdentifier, you are saying that you want to open the BookingDetail page to create a new Booking. 

What you want is to go back to the Booking you were seeing before. 

The confirmation page must have an input parameter called BookingId, right? 

So set the value of the BookingId parameter in the button to be the ButtonId input parameter of the page. It should be like this:

ButtonId = ButtonId

Yess, I have input parameter in the Confirmation page is BookingId same with BookingDetail page is it ok?

I tried like BookingId=BookingId before but I got the same error as now I'm using NullIdentifier()

When you call the Confirmation page from the BookingDetail, are you passing the correct BokkingId for the Confirmation page BookingId input parameter? 

Replace the NullIdentifier() by BookingId and try to do the Cancel to see what happens. Share here the error if it happens.

Eduardo Jauch wrote:

2. In the following action:

You first go fetch the booking by its Id. 

Than you are changing the status of this record in memory (the assignment). 

Then you are calling ChangeStatus. First question here: what are you passing to this action? 

Than you are calling Update oolong. Second question: what are you providing as the source record for this entity action? 

Third question: why are you using both ChangeStatus and Update Booking? 

1st question: I'm passing StatusId become CheckedOut

2nd question: this is the source UpdateBooking

3rd question: My thought is when I put ChangeStatus to change the booking status then I have to update it.

Is it the wrong way?

I think it will be easier if you just download your application and share it here (as attachment), so we can take a look. :)

About 3#. If you are already updating it inside ChangeStatus, you shouldn't need to update it after calling it.

Cheers.

Eduardo Jauch wrote:

I think it will be easier if you just download your application and share it here (as attachment), so we can take a look. :)

About 3#. If you are already updating it inside ChangeStatus, you shouldn't need to update it after calling it.

Cheers.

Regarding the Cancel button, I'm wrong at passing the BookingId for the Confirmation page BookingId input parameter. Thanks

I've attached the application, Sorry for my little knowledge about outsystem.



Hello Ayu,

The error message is happening on the first node of the action:

You are passing NullIdentifier() as input to the GetBookingForUpdate action.
The action will not find any booking in the database with a NULL identifier (as they are mandatory and usually start in 1), and this is raising an exception (the message you are seeing).

In this Screen Action you only need the ChangeStatus action. No need to fetch the data with the GetForUpdate or assign something (that was also wrong) or using UpdateBooking there.

The ChangeStatus should work.

Cheers.

Eduardo Jauch 

I've fixed for the status change when I click confirm check out button. I'm wrong at GetBookingForUpdate Id

Already changed the status correctly in list Bookings, but in Confirmation Page didn't show the correct data of DetailBooking. Is that wrong at the expression?



Eduardo Jauch wrote:

Hello Ayu,

The error message is happening on the first node of the action:

You are passing NullIdentifier() as input to the GetBookingForUpdate action.
The action will not find any booking in the database with a NULL identifier (as they are mandatory and usually start in 1), and this is raising an exception (the message you are seeing).

In this Screen Action you only need the ChangeStatus action. No need to fetch the data with the GetForUpdate or assign something (that was also wrong) or using UpdateBooking there.

The ChangeStatus should work.

Cheers.

Yes, ChangeStatus worked.

But I got the error in expression that show the incorrect data DetailBooking

Solution

Ayu Andini wrote:

Already changed the status correctly in list Bookings, but in Confirmation Page didn't show the correct data of DetailBooking. Is that wrong at the expression?

The error is in the aggregate (preparation) filter:

Fing like this.
You have a BookingId parameter that is receiving a Booking Id (let's say, 3).
Now, you need to fetch the information about this booking in the database.

So, you want to fetch data filtering by the id. Something like: "Database give me all the records that have the Id value of 3" (the one we want to see details).

What we need is to tell the database what we want to compare.

So, the correct filter is:

Booking.Id = BookingId

You will say: For each line in database entity Booking, compare the ID of the line in the database with the value inside the variable (Input Parameter) BookingId.

Change this and it should start working. 

Cheers.

Solution

Eduardo Jauch wrote:

Ayu Andini wrote:

Already changed the status correctly in list Bookings, but in Confirmation Page didn't show the correct data of DetailBooking. Is that wrong at the expression?

The error is in the aggregate (preparation) filter:

Fing like this.
You have a BookingId parameter that is receiving a Booking Id (let's say, 3).
Now, you need to fetch the information about this booking in the database.

So, you want to fetch data filtering by the id. Something like: "Database give me all the records that have the Id value of 3" (the one we want to see details).

What we need is to tell the database what we want to compare.

So, the correct filter is:

Booking.Id = BookingId

You will say: For each line in database entity Booking, compare the ID of the line in the database with the value inside the variable (Input Parameter) BookingId.

Change this and it should start working. 

Cheers.

Thanks a lot for the explanation Eduardo,

Now I can CheckOut booking with properly.

Cool :)