Dojo
Can I get some help (code snippet) of how I would set the security view IDs of a new reservation ? Everything I have tried so far in a silent booking script seems to not set the values on the reservation. Thanks.
SRM v 1.2.31
Hi Wale, never used it myself but can probably be done as follows:
var reservation = _bookingManager.CreateNewBooking(engine, bookingData, functions, null, properties);
reservation.SecurityViewIDs = new List<int> { 123 };
reservation = SrmManagers.ResourceManager.AddOrUpdateReservationInstances(reservation)[0];
Since SRM Framework 1.2.34/10.3.02, it’s possible to pass the SecurityViewIDs to CreateNewBooking. That’ll save an extra update of the booking.
var bookingData = new Booking
{
Description = “Game 1”,
…
SecurityViewIds = new HashSet { view.ViewID }
};
var reservation = _bookingManager.CreateNewBooking(engine, bookingData, functions, null, properties);
More details here: https://docs.dataminer.services/release-notes/SRM/SRM_1.2.34.html#booking-creation-now-supports-security-view-ids-id_37774
Perfect! Thanks Tom. I was missing that last line to update the Reservation instance.