Excerpt |
---|
Use the AvailableDimensionIds class to find the ids of dimensions (such as Staff or Resources) that are available for a given reservation. |
Info |
---|
This functionality is also available in Lightning (Screen) Flow, see the last section of this page. |
...
bgColor | white |
---|
titleBGColor | lightgray |
---|
borderStyle | solid |
---|
title | Methods |
---|
findAvailableDimensionIds
Panel |
---|
borderStyle | solid |
---|
title | findAvailableDimensionIds(context) |
---|
|
Declaration Code Block |
---|
| global static Set<Id> findAvailableDimensionIds(B25.AvailableDimensionIds.Context context) |
Parameterscontext (B25.AvailableDimensionIds.Context )
ReturnsSet<Id>: The dimension IDs that would not result in any conflicts, if used for the given Reservation and Dimension Field.
|
Panel |
---|
borderStyle | solid |
---|
title | findSingleAvailableDimensionId(context) |
---|
|
findSingleAvailableDimensionIdsThis method checks, in compliance with the conflict detection engine, which dimensions are available for a given reservation, and then returns a single ID of one of the dimensions. This is an invokable method and can be accessed from flows. Declaration Code Block |
---|
| global static List<AvailableDimensionIds.Result> findSingleAvailableDimensionId(List<AvailableDimensionIds.Context> contextList) |
ParameterscontextList (List<B25.AvailableDimensionIds.Context> ) : Only a single context needs to be passes. This property is a list in order to support bulkification.
ReturnsList<AvailableDimensionIds.Result>: A result object that contains a single dimension ID and a list of dimension IDs that would not result in any conflicts, if used for the given Reservation and Dimension Field. Only a single result object will be returned, this property is a list in order to support bulkification.
|
...
bgColor | white |
---|
titleBGColor | lightgray |
---|
borderStyle | solid |
---|
title | Inner Classes |
---|
...
borderStyle | solid |
---|
title | Context |
---|
Context Properties
...
B25__StartLocal__c
and B25__EndLocal__c
need to be set.- Make sure that any fields that influence conflict checking are set (i.e. the quantity of the reservation, or
B25__Status__r.B25__AllowDoubleBooking__c
if your Dimension Field is configured to skip conflict checking when this field equals true), or the result might not contain all available dimensions.
...
dimensionIds
(Set<Id>
): Scope of dimension IDs to limit the search to. These have to be of the same type as the dimension field that you are searching in.
...
excludedReservationIds
(Set<Id>
): Reservation IDs to ignore in conflict checking. This allows you to exclude reservations you are in the process of moving.
Note |
---|
|
The dimensionIds and dimensionRecordIds properties narrow down the search scope. This greatly improves performance for dimensions with many records. It is recommended to fill this parameter when searching in dimensions with a large amount of records. |
Panel |
---|
borderStyle | solid |
---|
title | Result |
---|
|
Return PropertiesavailableDimensionIds (List<Id>): A list of available dimension IDsavailableDimensionId (Id ) - A single ID of the first dimension in availableDimensionIds list.
|
Example
The following example shows how you can use B25.AvailableDimensionIds.findAvailableDimensionIds
method:
Code Block |
---|
|
public static Set<Id> getDimensions(B25__Reservation__c reservationIn, String dimensionFieldNameIn, Set<ID> dimensionIdsIn) {
B25.AvailableDimensionIds.Context context = new B25.AvailableDimensionIds.Context();
context.reservation = reservationIn;
context.dimensionFieldName = dimensionFieldNameIn;
context.dimensionIds = dimensionIdsIn;
return B25.AvailableDimensionIds.findAvailableDimensionIds(context);
} |
Lightning (Screen) Flow Apex Action
This functionality is also available as an Apex Action in Lightning Flow, called 'Find available dimension records':
...
Image Removed
Related articles
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@101b6 |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label = "apexapi" and type = "page" and space = "BPD" |
---|
labels | ApexApi |
---|
|
...
...