DimensionRecordRequest - gomeddo/js-sdk GitHub Wiki

Object that allows you to add different filters before sending a request for dimension records to the GoMeddo salesforce Rest API.

Example

const dimensionResult = gm.buildDimensionRecordRequest(dimensionName)
   .withAvailableSlotsBetween(startDatetime, endDatetime)
   .getResults()

withCondition

Syntax

withCondition(conditionObject1)
withCondition(conditionObject1, conditionObject2)
withCondition(conditionObject1, conditionObject2, /* … ,*/ conditionObjectN)

Parameters:

  • conditionObjectN The condition(s) you want to filter on. Of type Condition.

Return value: The updated dimension record request.

Description

Only return dimension records that match the conditions. Multiple conditions will be combined using AND.


includeAdditionalField

Syntax

includeAdditionalField(fieldname)

Parameters:

  • fieldname The fieldname of a field in salesforce on the dimension object you want to be returned from the request

Return value: The updated dimension record request.

Description

Add this field to the list of fields requested from the salesforce endpoint.


includeAdditionalFields

Syntax

includeAdditionalFields(fieldnameList)

Parameters:

  • fieldnameList The fieldnames of fields in salesforce on the dimension object you want to be returned from the request

Return value: The updated dimension record request.

Description

Add these fields to the list of fields requested from the salesforce endpoint.


withAvailableSlotsBetween

Syntax

withAvailableSlotsBetween(startOfRange, endOfRange)

Parameters:

  • startOfRange The start of the range you want to retrieve the time-slots for.
  • endOfRange The end of the range you wan to retrieve the time-slots for.

Return value: The updated dimension record request.

Description

Request on dimension records that are not fully booked between the two datetime. The input datetimes are interpreted in GMT When this is requested time-slots for the requested range are provided for each dimension record.


getResults

Syntax

await getResults()

Return value: A DimensionRecordResult object with the dimension records matching the request.

Description

async Calls the GoMeddo APIs to construct the requested dimension records.