BulkReservationValidator
- Maarten Lapere
- Luuk Koetsier (Unlicensed)
- Tim Schuitemaker
The BulkReservationValidator enables developers to validate one or more series of Reservations. It will return all the soft and hard conflicts that would arise, given the current configuration. For more information on how to configure conflict checking, see this article.
Methods
This method takes one or more lists of reservations wrapped in a Context class, and adds any detected soft or hard conflicts to them.
Signature
global static B25.BulkReservationValidator.Result validate(B25.BulkReservationValidator.Context)
Parameters
B25.BulkReservationValidator.Context
An instance of B25.BulkReservationValidator.Context. This class wraps the series of reservations to be validated.
Return Type
B25.BulkReservationValidator.Result
This is a dummy class without properties. This allows us to add properties later without changing the method signature. For now, developers can ignore the result, because the validation results are added to the individual B25.BulkReservationValidator.Reservation instances that were passed as the input.
Inner Classes
This class wraps the series of reservations to be validated.
Properties
This is a nested list of B25.BulkReservationValidator.Reservation instances, which are the wrappers around the reservations to be validated.
Reservations in the same list will be conflict checked as if they would be inserted together, so if they overlap they could conflict with each other. Reservations in separate lists will not conflict with each other.
This is a dummy class without properties. This allows us to add properties later without changing the method signature. For now, developers can ignore the result, because the detected are added to the individual B25.BulkReservationValidator.Reservation instances that were passed as the input.
This class wraps a B25__Reservation__c object, as well as related child objects of the reservation. It has two additional properties, softConflicts and hardConflicts, which will be set by the validate method.
Properties
The record that you want to validate. Any related child records should be added to the childRecords property.
This map allows you to specify related child records that should also be validated, such as a list of ReservationContacts. Use the relationship name as the key (so 'B25__ReservationContacts__r' for example).
This property will be set by the validate method. It will contain all the soft conflicts that would be generated if the Reservation would be saved to the database.
This property will be set by the validate method. It will contain all the hard conflicts that would be generated if the Reservation would be saved to the database.