Change dropdown value based on condition

Hi everyone,

I'm having trouble creating the Booking System app,so my program has 3 order states = Accepted, Rejected and Sent.
It also has an order start time and an end booking time.

And when a "regular user" requests an order, the request will appear in "Admin Roles". and "Admin Role" will set status to accepted/rejected and assign item with dropdown.

So, what I want to make is that when an item is booked (accepted) during the book start time and end time, when another "regular user" wants to book an item with the same start and end time as the booked item, the booked item will disappear in the dropdown .

Is it possible? If yes, how to do that?

I attached my oml below, so you guys would be more understand..
you can log in with your super admin account for seeing all features,

You can go to My Bookings menu and then add some request, then the request will be appear on dashboard. After that, you can click on the request list, the pop up will show and you can see the dropdown there.

Thankyou

Best Regards,
Ran


BookingSystem.oml

Solution

For clarifying your implementation:

  1. In TrxBookingDetailPage, I found the Item dropdown is just shown for admin to select, not for regular user
  2. You should put the Item dropdown below the booking time start and end, so that you can use them as the input for filtering the item

For filter out the data, I recommend that you should add something like this in your aggregate

  1. left join with the booking data like the condition you mentioned above
  2. add condition to determine the left join should return no data


Hope this help

Thanks and best regards,

Shingo

Hi Bhetrand,


I believe that you load your dropdown by an aggregate, the easiest way to solve the happy case is to add more condition in that aggregate to filter out the booked item. The smoggy case is still there for further implementation

  1. Happy case: the item is booked already, the regular user comes and loads the dropdown. More condition the aggregate is ok
  2. Smoggy case: the item is setting booked when the regular user already loaded the dropdown. In this case, you cannot filter out the booked item from the dropdown (already loaded on UI), you will have a check when saving and show error

Hope this help

Thanks and best regards

Shingo

I already tried to solve it by Happy case, but i can't find the right filter for the aggregate, may you give me some examples for that filter? Anyway thank you for the respond

Best Regards,
Ran

Solution

For clarifying your implementation:

  1. In TrxBookingDetailPage, I found the Item dropdown is just shown for admin to select, not for regular user
  2. You should put the Item dropdown below the booking time start and end, so that you can use them as the input for filtering the item

For filter out the data, I recommend that you should add something like this in your aggregate

  1. left join with the booking data like the condition you mentioned above
  2. add condition to determine the left join should return no data


Hope this help

Thanks and best regards,

Shingo

Hello Shingo,
Sorry for just responding..
i would like to say thankyou very much,,i really really appreciated it!
Thankyou Shingo!!
Hope you blessed :D

You are welcome.

Hope my solutions come to right person at right time

Thanks and best regards

Shingo

Hi shingo, actually im already tried your solution, and it have some new progress, but it still doesn't exactly going right, it like only check first row..
Actually what i want to create is like when the Description "13-8" with duration 14:00 until 16:02 already get Car B, then the first request with duration 14:00 until 15:00 will no having dropdown list with item Car B, so i supposed there will be only item Car A..
Can you help me once again?

Very thanks!

I attached my oml , so you can go to screen TrxBookings and Add Booking as user, then you can login as admin and go to TrxBookingsCar screen and try there..
Thankyouu

Please help me,
Best Regards,
Ran

BookingSystem.oml

First of all, I think you need to reload the page to let the dropdown filter out the car B (if your condition is correct).

Moreover, you let the dropdown auto filters out the car B when the 13-8 changed, it is not so easy like that. For the real time refresh, you should use something like socket or firebase to catch the notification about the change of car B to reload the dropdown

Thanks and best regards

Shingo

Hi @Bhetrand Dwilangga ,

I have tried on the add booking for car function, it works.

Please view my oml for more detail

Thanks and best regards

Shingo

BookingSystem.oml

Thankss very much Shingoo!!

I really really appreciated for it!!
Thankyouu!
Hope you blessed!!

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