32
Views
39
Comments
Solved
View user specific booking
Question

Hi Team,

After saving the booking ,If user clicks on view booking the details are not getting shown,Booking Id is not getting passed to view booking screen.It is always sending 53 as booking Id ,But In table I can see the new booking Id has created.

on click of viewBookings.no data displayed as it is sending booking Id as 53 everytime

Rank: #300
Solution

The Radio group is bind with the PreferredFoodTypeId Identifier which is storing the value of entity identifier for the selected item into the group.

The below screenshot is the inspect of the page where you can see that value of each radio button is different, but name is same for radio button group (PreferredFoodTypeGroup). I hope this will clear all your confusion related to radio button group.

Rank: #300
Solution

Hi Ujwwala,

Please find attached OML with changes to pull the time from BookingSlot entity instead of Foodtype entity. Kindly review it and let me know, if you need any other help.

For button you can use it's style property or write your own CSS.


Thanks & Kind Regards,

Sachin

Appres771.0.Sachin08oml.oml

Rank: #300
Solution

Please find attached the updated OML. I have made some changes into both User/Admin Booking Screens. 

1. Admin Screen - > Records will save into both entities (BookingSlot and TimeForFood).

2. User Screen --> Time will be selected based on the Selected Food Type on screen and Record will save only into BookingSlot entity.

Kindly check and confirm.

Thanks & Kind Regards,

Sachin

Appres1Sachin04.oml

Rank: #2442
Solution

Hi Ujwwalla,

That's correct :). But like I said above the guided training paths will explain alot of the basics in outsystems and will help you a long way in to the platform. Link: https://www.outsystems.com/training/paths/ 

Also make sure to mark a post as solution if your question has been answered.


Greetings,


Nick


Rank: #300

Hi Ujjwwala,

Could you please share the OML to look into this issue?

Thanks & Kind Regards,

Sachin

Rank: #300

Hi Ujjwwala,

Please find attached the updated OML. I have made the changes to CreateBookingScreen and ViewBooking screens. In ViewBooking screen I have just soft deleted the record i.e. updated the booking status to "Cancelled" from "Booked". 

Thanks & Kind Regards,

Sachin

AppSachin010221.oml

Hi Sachin,

I have one query as when passed foodType-createbooking screen- I have created separate aggregate but in Text option text It is not showing the time ,The time option is not coming -If I give explicitly it comes,Any reason please.

App88.oml

Rank: #300

Hi Ujwwala,

It looks like you don't have some records into the BookingSlot entity to pull the time from this entity. Can you please confirm?

Thanks & Kind Regards,

Sachin

Hi Sachin,

 If I use GetBookingSlotsbyId.List as a list for Time dropdown then I can select  the Text as Bookingslot.Time ,But if I select above list name as per screenshot,I can not select option Text automatically.

Rank: #300

Hi Ujwwala,

I tried the both list options (GetBookingSlotById and GetBookingSlotsByFoofTypeId) and see that from both the list it is assigning the BookingSlot.Name into dropdown's Option Text property. And, we have to change it explicitly to BookingSlot.Time to populate the dropdown with Time.

As per my understanding, since dropdown's Options Contents defaults to "Text Only", the Option Text property looks for the entity attributes which are having data type as Text in the first place and in the Booking Slot entity it found Name attribute. So, for this reason it is default assigning BookingSlot.Name into the Text property instead of Time since it's datatype is Time not Text.

Hope this will make sense and resolve your query. :) And for more details please refer this link.

Thanks & Kind Regards,

Sachin



Rank: #2442

Hello,


It's a bit hard to locate the issue from those screenshots alone, is it possible to share the oml? For example I can see that for the bookingId you are passing on you are using a list, are u sure this list is filtered and that it is using the right Id? It can also be that you forgot to refresh your data after saving your booking. Since you are saying its always id 53 my bet is that your aggregate doesn't have the right filters. The oml could help me find the problem


Also Please let me know how to cancel booking,Do I need to create any action on canel,I have just assigned cacelled status to record.PLease check.how to update cancelled status for the same record.

App.oml

mvp_badge
MVP
Rank: #113

Hi Ujwwala,

From the screenshots you have shared on thing I can notice is that you are passing BookingSlotId not BookingId.

Also please let me know hoe to cancel the record specific.

App.oml

Rank: #2442

Hello,

I updated your code a bit and created a new action (BookingSlotActionNick). In here I have placed some comments so it might help you understand the code a little bit better. For deleting a Bookingslot you just have to use the deleteaction and the right Id. 


Besides that, this is very basic OutSystems, have you followed the training path? This can help you understand the platform better. You can find the different training paths on the following link:


https://www.outsystems.com/training/paths/


App.oml

Hi Nick,

Thanks for the reply,I have tried similar what you have done but getting Insertion error on Save booking slot as User.

Can you please guide what is wrong here.

App1.oml

Hi Nick,

Can you please let me know how to add the time in foodTime table  while adding slot,I have created flow but records are not getting added in timefood table.I want to return list of time from aggregate to populate on createbooking screen(on selection of foodtype).

Kindly suggest

Appres.oml

Rank: #300

Hi Ujwwala,

First of all you need to design a new screen to add the time in Timeforfood entity. Since it looks like you are trying to pull the time based on the PreferredFoodTypeID from TimeforFood entity which is only possible when there are different entries exist into this entity for PreferredFoodType. 

Please refer the attached OML for reference.

If you need any help, please feel free to let me know.

Thanks & Kind Regards,

Sachin

AppresSachin03.oml

Hi Sachin,

Thank you .

I want to add the entries in the table timeforfood at the same time of booking slot .So in one server action I wanto update both the tables,will it be possible,also please let me by this way how we can return time list from aggregatr timeforfood table by passing foodtype a,

Thank you

Rank: #300

Yes, it is possible to add the records into the TimeForFood and BookingSlot entities in the same server action. However, could you please confirm from which entity you want to display the time in the CreateBookingScreen? Since you are trying to get the time and populate the time dropdown from TimeForFood entity and at the same time want to add the time into these 2 entities which is not possible.

In your question of how you can return time from aggregate from TimeForFood entity - On the change event of FoodType dropdown an client action has been triggered which will populate the data into the aggregate based on the selection of FoodType by passing the FoodTypeIndentifier ID. I have done this for you in the OML attached yesterday. Please check client action Dropdown1OnChange3 in CreateBookingScreen and the aggregate added to it.

Thanks & Kind Regards,

Sachin

Hi Sachin,

When admin is doing booking slot at the same time entry should go to timefood and from user specific booking he should pass the typefood and get the time list from aggregate from timefood .

I have tried o update in two table but is inserting into timefood table as default entries,

Please suggest

Appres1.oml

Rank: #300
Solution

Please find attached the updated OML. I have made some changes into both User/Admin Booking Screens. 

1. Admin Screen - > Records will save into both entities (BookingSlot and TimeForFood).

2. User Screen --> Time will be selected based on the Selected Food Type on screen and Record will save only into BookingSlot entity.

Kindly check and confirm.

Thanks & Kind Regards,

Sachin

Appres1Sachin04.oml

Hi Sachin,

Thank you for the reply,

I have created two role and two users Admin/User where in based on roles they should redirect ,I have given screen based roles ,But it is only redirecting to admin role screen only.

Appres7.oml

Rank: #300

Hi Ujwwala,

You are passing Username into the CheckRoleAction where as it requires UserID. I have made some minor changes, please verify it in the attached OML and let me know, if you need any other help. 

Have a great ahead!!

Thanks & Kind Regards,

Sachin

Appres7Sachin06.oml

Hi Sachin,

Thank you .

I have tried with the oml you sent but with the users craeted it is not navigating to screen for which roles I have assgned already.

Also from user link, personal-hcea5oih.outsystemscloud.com/Users) ,I have craeted two users and assigned role to them but now I am not able to login with AdminUser and pwd as AdminUser-It saysInvalid Permissions (personal-hcea5oih.outsystemscloud.com) ,

Please let me know wht can be the reason for not rediecting to respective screen and also not able to login ad adminUser .

Invalid permission issue is resolved now,But with the two created users I am not able to redirect to their respective screens.I have set the roles screenwise,Is this the correct way or is there any alternative way instaed of every time time screenwise we need to do.

Thank you

Rank: #300

Please refer the attached OML and let me know if you need any other help. I have made some changes into the Login Client Action. On the Login button submission I had called "Login" client action and into this action called your created client action LoginClient to verify which role that particular have and based on the redirected to the User/Admin page.

Appres7Sachin06Ver1.0.oml

Hi Sachin,

Thank you for your reply in earlier post,In addition to this instead of creating separate timefood entityi I am trying to fetch from the main entity bookingslot passing foodtype but it is not filtering  in createbookingscreen

Also kindly let me know the style for all buttons they need to fixed at places.(They are not alligned)

User: AdminUser Pwd:AdminUser


Appres771.0.oml

Rank: #300
Solution

Hi Ujwwala,

Please find attached OML with changes to pull the time from BookingSlot entity instead of Foodtype entity. Kindly review it and let me know, if you need any other help.

For button you can use it's style property or write your own CSS.


Thanks & Kind Regards,

Sachin

Appres771.0.Sachin08oml.oml

Hi Sachin,

Thank you for reply,

AS per this I can see after refreshing aggregate we should populate list in time dropdown and the value should be time .I see its Id any specific reason.Please clarify.

Also  to filter  records in aggregate do we need to create local variable again as we are not able to select bookingslot object's foodtypeId.Any reason.Please clarify.


Rank: #300

Hi Ujwwala,

Please see below the answers for your questions.

1. Generally, when we bind a dropdown to any entity we used to setup it's variable to that particular entity identifier, so when we save record it's identifier get saved into the referenced entity. So, for this reason I had bind the Time dropdown with BookingSlot entity identifier.

2. As far as I know, Yes. Since, we need to pass the entity identifier into the filter parameters for the selected value from dropdown.

Kindly, let me know, if you need any other clarification.

Thanks & Kind Regards,

Sachin

  

Hi Sachin,


Thank you for earlier reply,

Would like to use radio button group to pass preferredfoodTypeId in craetebookinscreen.

same as dropdown,But mapping id is not getting.


Thank you

App25.oml

Rank: #300

Please see attached updated OML. I have added radio button group on the createBookingScreen.

App25Sachin28.oml

Hi Sachin,

As seen and the passed value of radio button each is Label value ,but in table it is storing as value.

It seems se dont get option as entites.statisentity.Id option?

PLease clarify how in backend it is storing as ID(Is it because the variable radiogroup is mapped to PreffoodIDentifier?)

Rank: #300
Solution

The Radio group is bind with the PreferredFoodTypeId Identifier which is storing the value of entity identifier for the selected item into the group.

The below screenshot is the inspect of the page where you can see that value of each radio button is different, but name is same for radio button group (PreferredFoodTypeGroup). I hope this will clear all your confusion related to radio button group.

Hi Sachin,

Thank you for the reply,Seeing HTML as usual flow ,now it is clear.


Regards,

Ujwwala

Hi Sachin,

I am going through web block but source and target blocks example I am not getting clarity.

I am not getting why we have input parameters in source block .Ideally Instead if we need to pass it to parent  or target block it should be as local variable as sender.(Also source block events we have input parameter)

If you have any sample oml of source web block and target web block,Kindly provide

Thank you

Rank: #300

Please see attached Sample OML for web blocks. Kindly look into this and let me know, if you have any question.

StarSachin.oml

Rank: #2442

Hello ujwawala,


The issue is that you linked your aggregate to your form and you're not taking the local variable. The issue here is because you don't do that, you are trying to create a bookingslot without values and since the preferredfoodtype is a mandatory field the database is complaining that he can't create a bookingslot without preferredfoodtype. So what do you need to do: 

In your form you need to assign every inputfield to the local variable like in this screenshot:

Make sure to apply it aswell to the field above it so you have a record that is filled with data.


Thank you Nick for your quick help.

So as I understood whenever we need to submit the form we should send it as local variable and on server action to pass finally to the createDB Record

So above rule is general I can consider whenever we are inputting from form and it is kind of post request with Body and we are sending while object(local object in outsystem) and mapping form values individually to this object and finally passing to server action which in turn will be responsible to make entry to the database table.

Thanks,

Ujwwala

Rank: #2442
Solution

Hi Ujwwalla,

That's correct :). But like I said above the guided training paths will explain alot of the basics in outsystems and will help you a long way in to the platform. Link: https://www.outsystems.com/training/paths/ 

Also make sure to mark a post as solution if your question has been answered.


Greetings,


Nick