Skip to main content
Skip table of contents

B25.RelatedList

Overview

A related list represents a list of records present on a form.

A related list holds zero or more B25.RelatedListItems.

Like a form, a related list has getters to access lower level elements such as the fields that exist on the related list.

Like a lookup, a related list supports search handlers being added to it.

Methods

getField

CODE
B25.FormField getField(SObjectField fieldToken)

This method will return a FormField object for the specified SObjectField. The SObjectField must be a valid field for the SObjectType of the related list. For example, if you are on the out-of-the-box Contacts related list, the field must exist on B25__ReservationContact__c.

Return value:B25.FormField

Parameters:

Name

Type

Description

fieldToken

SObjectField

The field that you want to get.


getLookup

CODE
B25.Lookup getLookup(SObjectField fieldToken)

Similar to getField, but instead this method will return a Lookup object for the specified SObjectField. TThe SObjectField must be a valid lookup field for the SObjectType of the related list. For example, if you are on the out-of-the-box Contacts related list, the field must be a lookup that exists on B25__ReservationContact__c.

Return value:B25.Lookup

Parameters:

Name

Type

Description

fieldToken

SObjectField

The field that you want to get.


onSearch

CODE
void onSearch(B25.SearchContext.SearchHandler handler)

Adds a search handler to this related list. This handler will be called when the user searches in this related list. Note: calling this method outside of the customize method (defined in B25.Form.Customizer) has no effect.

Parameters: B25.SearchContext.Handler

Parameters:

Name

Type

Description

handler

B25.SearchContext.Handler

The handler to generate results when the user searches in this list.


onAdd (without parameters)

CODE
List<B25.FormEventHandler> onAdd()

Returns a reference to the list of handlers that have been defined to trigger when a record is added to the list by the user. Because this method returns a reference to the actual list (and not a copy), any changes you make to this list will directly affect the defined handlers. This method is intended to be used in the customize method defined in your implementation of the B25.Form.Customizer interface. Using it anywhere else, such as inside one of your event handlers, will not have any effect.

Return value: List<B25.FormEventHandler>


onAdd (with parameter)

CODE
void onAdd(B25.FormEventHandler handler)

Adds the given handler to the list of handlers that have been defined to trigger when a record is added to the list by the user. This method is a convenience method, and is identical to calling onAdd().add(B25.FormEventHandler handler).

Parameters:

Name

Type

Description

handler

B25.FormEventHandler

The handler to trigger when a record is added to this list.


onRemove (without parameters)

CODE
List<B25.FormEventHandler> onRemove()

Returns a reference to the list of handlers that have been defined to trigger when a record is removed from the list by the user. Because this method returns a reference to the actual list (and not a copy), any changes you make to this list will directly affect the defined handlers. This method is intended to be used in the customize method defined in your implementation of the B25.Form.Customizer interface. Using it anywhere else, such as inside one of your event handlers, will not have any effect.

Return value: List<B25.FormEventHandler>


onRemove (with parameter)

CODE
void onRemove(B25.FormEventHandler handler)

Adds the given handler to the list of handlers that have been defined to trigger when a record is removed from the list by the user. This method is a convenience method, and is identical to calling onAdd().add(B25.FormEventHandler handler).

Parameters:

Name

Type

Description

handler

B25.FormEventHandler

The handler to trigger when a record is removed from this list.


addRecord

CODE
void addRecord(SObject record)

Adds a record to the related list.

Parameters:

Name

Type

Description

record

SObject

A record to be added to the list. Must be of the same SObjectType as the related list itself.


remove

CODE
void remove(B25.RelatedListItem item)

Removes an item from the related list.

Parameters:

Name

Type

Description

item

B25.RelatedListItem

The item that you want to remove from the list.


getItems

CODE
List<B25.RelatedListItem> getItems()

Returns all the items that are in the related list.

Return value:List<B25.RelatedListItem>


getItem

CODE
B25.RelatedListItem getItem(String guid)

This method will return a FormField object for the specified SObjectField. The SObjectField must be a valid field for the SObjectType of the related list.

Return value:B25.FormField

Parameters:

Name

Type

Description

fieldToken

SObjectField

The field that you want to get.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.