Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Returns the Form object that the user has performed the search on. This can be useful to get more information about the other fields that have been filled in on the reservation, using the Form.getReservation method.

Return value: B25.Form

...

getConditions

Code Block
List<String> getConditions()

...

Code Block
addCondition('Account = \'' + accountId + '\'');

Parameters:

Name

Type

Description

condition

String

The condition that you want to add.

...

getSearchFields

Code Block
List<String> getSearchFields()

...

Code Block
searchContext.addSearchField('Account.Name');

Parameters:

Name

Type

Description

fieldName

String

The API name of a field that you want to be searched.

...

setLabelTemplate

Code Block
void setLabelTemplate(String template, List<String> mergeFields)

...

Code Block
searchContext.setLabelTemplate('{0}', new List<String>{'Name'});

Parameters:

Name

Type

Description

template

String

A string containing numbered placeholders which will be replaced with actual values in the final result.

mergeFields

List<String>

An ordered list of merge field API names. These will replace the matching placeholders in the template with each record’s actual values.

...

setMetaTemplate

Code Block
void setMetaTemplate(String template, List<String> mergeFields)

...

If the user performing the search has no access to any of these fields, they are replaced with an empty string.

Parameters:

Name

Type

Description

template

String

A string containing numbered placeholders which will be replaced with actual values in the final result.

mergeFields

List<String>

An ordered list of merge field API names. These will replace the matching placeholders in the template with each record’s actual values.

...

setDefaultIcon

Code Block
void setDefaultIcon(String icon)

...

Code Block
searchContext.setDefaultIcon('utility:activity')

Parameters:

Name

Type

Description

icon

String

The name of the icon.

...

setOrderBy

Code Block
void setOrderBy(String orderField, String sortOrder)

Used to override the sorting mechanism for the results generated through this context.

For example, searchContext.setOrderBy('Email', 'ASC NULLS LAST') will alphabetically sort the returned records by the Email field on the object, with the records that contain no email address put at the bottom.

Possible values for sort order include:

  • ASC NULLS FIRST

  • ASC NULLS LAST

  • ASC

  • DESC NULLS FIRST

  • DESC NULLS LAST

  • DESC

Return value: B25.SearchResult

Code Block
searchContext.setOrderBy('Email', 'ASC NULLS LAST')

Parameters:

Name

Type

Description

orderField

String

The field name that will be used to sort the results.

sortOrder

String

The sorting clause that will be applied to the results.

...

setOrderBy

Code Block
void setOrderBy(List<String> orderFields, List<String> sortOrders)

Used to override the sorting mechanism for the results generated through this context. Results will be ordered by the entries in orderFields and sortOrder, starting with the first in each of the two lists.

Take the following example:

Code Block
List<String> orderFields = new List<String>{'FirstName', 'LastName'};
List<String> sortOrders = new List<String>{'ASC NULLS LAST', 'DESC'};

searchContext.setOrderBy(orderFields, sortOrders);

This will alphabetically sort the returned records by the FirstName field on the object, with the records that contain no FirstName put at the bottom.

Then, for each record with a duplicate FirstName, the records will be ordered by how recently they were created.

Note that the number of ordering fields must match the number of sort order clauses provided.

Possible values for sort order include:

  • ASC NULLS FIRST

  • ASC NULLS LAST

  • ASC

  • DESC NULLS FIRST

  • DESC NULLS LAST

  • DESC

Return value: B25.SearchResult

Code Block
searchContext.setOrderBy(new List<String>{'FirstName', 'LastName'}, new List<String>{'ASC NULLS LAST', 'DESC'})

Parameters:

Name

Type

Description

orderFields

List<String>

The field names that will be used to sort the results.

sortOrders

List<String>

The sorting clauses that will be applied to the results.