Versions Compared

Key

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

This article provides the full reference of every method and object available to you as part of the custom form logic feature. For other articles on this topic, see:

B25.FormAPI.Customizable interface

As illustrated in the Quick Start Guide, the B25.FormAPI.Customizable interface is what you need to implement to attach your own handlers to the form. It only has one method, with the following signature:

Code Block
void customize(B25.FormAPI.Form form)

Parameters: B25.FormAPI.Form

B25.FormAPI.EventHandler interface

This is the interface that you must implement in your custom event handlers. It has one method that receives the event and a reference to the form. The event can be used to get information about what the user did on the form, such as the value they entered in a field. The form can be used to get information about the current (reservation) record, as well as records in related lists. You can also use it to trigger new changes, such as updating another field or adding a record to a related list.

Code Block
void handleEvent(B25.FormAPI.FormEvent event, B25.FormAPI.Form form)

Parameters: B25.FormAPI.FormEvent, B25.FormAPI.Form

B25.SearchAPI.SearchHandler interface

This is the interface that you must implement in your custom search handlers. It has one method that receives a SearchContext object with information related to the search performed by the user. It must return a SearchResults object containing the result items that you want the user to see.

Code Block
B25.SearchAPI.SearchResults getResults(B25.SearchAPI.SearchContext context)

B25.FormAPI.FormEvent class

This class contains information about something that has happened on the form.

Methods

getNewValue

Code Block
Object getNewValue()

This method will return the new value as a result of the event. For example, if the user enters a text in a text field, this method will return the String representation of what the user entered.

Return value: Object

getGuid

Code Block
String getGuid()

If this event was generated on a record in a related list, this will return the unique identifier for that record. This value can be used to identify a specific entry in a list of related list items.

Return value: String

B25.FormAPI.Form class

Besides allowing some actions directly on the form (such as setting an init handler in the customize method described above), the Form class also holds information about the structure of the form. Use its getter methods to access lower level elements on the form, such as fields or related lists.

Methods

getField

Code Block
B25.FormAPI.Field getField(SObjectField fieldToken)

This method will return a Field object for the specified SObjectField. The SObjectField must be an existing reservation field.

Parameters: SObjectField

Return value:B25.FormAPI.Field

getLookup

Code Block
B25.FormAPI.Lookup getLookup(SObjectField fieldToken)

Similar to getField, but instead this method will return a Lookup object for the specified SObjectField. The SObjectField must be an existing lookup field on reservation.

Parameters: SObjectField

Return value:B25.FormAPI.Lookup

getRelatedList

Code Block
B25.FormAPI.RelatedList getRelatedList(SObjectType sObjectToken)

Returns the related list associated with the passed SObjectType.

Parameters: SObjectType

Return value:B25.FormAPI.RelatedList

B25.FormAPI.Field class

This object represents a field on the form. This can be either a field on the main form, or on a related list.

Methods

onUpdate

Code Block
void onUpdate(B25.FormAPI.EventHandler handler)

Adds an event handler to this field. This handler will be called when the field is updated on the form by the user. Note: calling this method outside of the customize method (defined in B25.FormAPI.Customizable) has no effect.

Parameters: B25.FormAPI.EventHandler

update

Code Block
void update(Object newValue)

Updates this field’s value to a new value. This can be used inside the handleEvent method as defined in B25.FormAPI.EventHandler.

Parameters: Object

B25.FormAPI.Lookup class

This object represents a lookup field on the form. This can be either a field on the main form, or on a related list. It is very similar to the B25.FormAPI.Field object, but has extra support for adding SearchHandlers.

Methods

onSearch

Code Block
void onSearch(B25.SearchAPI.SearchHandler handler)

Adds a search handler to this lookup field. This handler will be called when the user searches in this lookup. Note: calling this method outside of the customize method (defined in B25.FormAPI.Customizable) has no effect.

Parameters: B25.SearchAPI.SearchHandler

onUpdate

Code Block
void onUpdate(B25.FormAPI.EventHandler handler)

Adds an event handler to this field. This handler will be called when the field is updated on the form by the user. Note: calling this method outside of the customize method (defined in B25.FormAPI.Customizable) has no effect.

Parameters: B25.FormAPI.EventHandler

update

Code Block
void update(Object newValue)

Updates this field’s value to a new value. This can be used inside the handleEvent method as defined in B25.FormAPI.EventHandler.

Parameters: Object

B25.FormAPI.RelatedList class

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

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 Block
B25.FormAPI.Field getField(SObjectField fieldToken)

This method will return a Field object for the specified SObjectField. The SObjectField must be a field that exists on the SObjectType of this related list.

Parameters: SObjectField

Return value:B25.FormAPI.Field

getLookup

Code Block
B25.FormAPI.Lookup getLookup(SObjectField fieldToken)

Similar to getField, but instead this method will return a Lookup object for the specified SObjectField. The SObjectField must be a lookup field that exists on the SObjectType of this related list.

Parameters: SObjectField

Return value:B25.FormAPI.Lookup

onSearch

Code Block
void onSearch(B25.SearchAPI.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.FormAPI.Customizable) has no effect.

Parameters: B25.SearchAPI.SearchHandler

onRecordAdd

Code Block
void onRecordAdd(B25.FormAPI.EventHandler handler)

Adds an event handler to this field. This handler will be called when a record is added to this related list. Note: calling this method outside of the customize method (defined in B25.FormAPI.Customizable) has no effect.

Parameters: B25.FormAPI.EventHandler

onRecordRemove

Code Block
void onRecordRemove(B25.FormAPI.EventHandler handler)

Adds an event handler to this field. This handler will be called when a record is removed from this related list. Note: calling this method outside of the customize method (defined in B25.FormAPI.Customizable) has no effect.

Parameters: B25.FormAPI.EventHandler

addRecord

Code Block
void addRecord(SObject record)

Adds a record to this related list.

Parameters: SObject

remove

Code Block
void remove(B25.FormAPI.RelatedListItem item)

Removes an item from this related list.

Parameters: B25.FormAPI.RelatedListItem

On this page

Table of Contents