Salesforce Asked by Prerana on October 4, 2021
I have a flow to "Add a Reservation" from Account. The user needs to select the site (Lookup to Account – type site), Asset (Room) and enter the start and end date of the reservation.
I am having issue checking if there is a reservation for the same site, same asset between the entered start or end date. The trouble is with the date range.
My flow looks like this:
My getReservation filters looked like this: (This just checks if there is any reservation between the start and end date you entered, which is wrong. I want it to check if the dates I entered is a part of any existing reservation)
I tried something like the below, where I tried to get all CONFIRMED reservations for that site and asset. I tried to iterate over this collection, then I placed the decision component to check if my start or end date falls in between any of the existing reservation’s dates. I am not sure how to close or end this loop.
My filters for the decision is :
I want to know if this approach is correct or can this be done in a much simpler way?
I would appreciate any help in this!
Thank you
You are querying multiple records in the Get Records element getEligibleReservation. However, the loop Loop Reservation only checks for the first record and redirects it to either Confirmation or Duplicate Reservation screen.
Delete the connector No existing Reservation that connects to the Confirmation screen. Instead, connect this back to the loop Loop Reservation. There would be one more connector coming out from the loop After last Item. Connect this connector to the Confirmation screen.
Now, we are checking for all records in the collection. If there is a record with an existing reservation, the user is redirected to the Duplicate Reservation screen. If there is no such record in the whole collection, the user gets redirected to the Confirmation screen.
Correct answer by Prakhar Saxena on October 4, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP