Only one event at a time range
Collapse
X
-
API Before Save script:
Code:$message = "An event on the same time slot already exists."; if (entity\isNew() && assignedUserId) { $existingId = record\findOne( 'Event', null, null, 'assignedUserId=', assignedUserId, 'dateEnd>', dateEnd, 'dateStart<', dateEnd ); if ($existingId) { recordService\throwConflict($message); } $existingId = record\findOne( 'Event', null, null, 'assignedUserId=', assignedUserId, 'dateEnd>', dateStart, 'dateStart<', dateStart ); if ($existingId) { recordService\throwConflict($message); } $existingId = record\findOne( 'Event', null, null, 'assignedUserId=', assignedUserId, 'dateEnd<=', dateEnd, 'dateStart>=', dateStart ); if ($existingId) { recordService\throwConflict($message); } }
Last edited by yuri; 07-25-2023, 02:24 PM.Leave a comment:
-
There is no such a class, you just need to add your own logic. there are many ways to achieve this depend on your business logic.Leave a comment:
-
Has anyone managed to write such a class? I'm looking for a solution too.Leave a comment:
-
You may need to have custom duplicate checker class, follow this doc:
Leave a comment:
-
Manage bookings, marketing and invoicing with EspoCRM Currently, the hotel industry is one of the fastest-growing, competitive sectors. As guests become more digitalized and price-conscious, building loyal relationships and attracting new guests becomes an increasingly complicated process.
I see record: "Monitor the availability of rooms & services"
Somone can help?Leave a comment:
-
Only one event at a time range
Hello,
I create new event entity ' Rooms Reservation'. Do you have any way to make it impossible to book one room at the same time?
Possibly any warning that there is a reservation in a certain period of time?
Regards,
RobertTags: None
Leave a comment: