Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Overview

This class represents one result shown to the user when they search in a lookup or a list.

Your search handlers are expected to return SearchResults bundled together in a SearchResult.Collection instance.

Example

global with sharing class MySearchResults implements B25.SearchContext.SearchHandler {
    global B25.SearchResult.Collection getResults(B25.SearchContext context) {
        B25.SearchResult.Collection collection = new B25.SearchResult.Collection();
        collection.addSearchResult(new B25.SearchResult('some-identifier', 'Hello World!'));
        return collection;
    }
}

Inner Classes

B25.SearchResult.Collection

 Click here to expand...

Use this class to bundle together multiple instances of B25.SearchResult. This is what is expected to be returned by B25.SearchContext.SearchHandler.

addResult

void addSearchResult(B25.SearchResult searchResult)

Adds the given search result to this collection.

Parameters:

Name

Type

Description

searchResult

B25.SearchResult

The search result you want to add.

addResults

void addSearchResults(List<B25.SearchResult> searchResults)

Adds the given search list of results to this collection.

Parameters:

Name

Type

Description

searchResults

List<B25.SearchResult>

The list of search results you want to add.

Methods

setSelectable

B25.SearchResult setSelectable(Boolean selectable)

Sets the ‘selectable’ property for this result. A result that is not selectable can’t be selected by the user. This is useful for displaying information to the user. The default value is true.

Return value: B25.SearchResult

Parameters:

Name

Type

Description

selectable

Boolean

The value for the ‘selectable’ property.


setPreventDefault

B25.SearchResult setPreventDefault(Boolean preventDefault)

Sets the ‘prevent default’ property for this result. A result that has ‘prevent default’ enabled, will not be added to the list when selected. This is useful for showing options which should trigger custom logic instead of adding a record. The default value is false.

Return value: B25.SearchResult

Parameters:

Name

Type

Description

preventDefault

Boolean

The value for the ‘prevent default’ property.


setMetaText

B25.SearchResult setMetaText(String metaText)

This method sets the meta text for the result.

Return value: B25.SearchResult

Parameters:

Name

Type

Description

metaText

String

The text that you want to set.

On this page

  • No labels