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

Version 1 Current »

Overview

Represents a record on the form. Contains a reference to the actual SObject.

You can get a reference to the active record (the one currently being viewed/edited) by calling getActiveRecord() on a B25.Form instance.

Example

global with sharing class ExampleHandler extends B25.FormEventHandler {
    global override void handleEvent(B25.FormEvent event, B25.Form form) {
        // set the title of the current record
        form.getActiveRecord().put(B25__Reservation__c.B25__Title__c, 'Hello World');
    }
}

Methods

getSObjectClone()

SObject getSObjectClone()

Returns a clone of the SObject record. Note that modifications to this record will not be reflected on the form. In order to do that, use the put method instead.

Return value: SObject


put(SObjectField, Object)

void put(SObjectField fieldToken, Object value)

Sets the specified field on the record to the specified value, and updates the field on the form. Does not trigger any handlers that have been added to the field.


put(SObjectField, Object, Boolean)

void put(SObjectField fieldToken, Object value, Boolean triggerChangeHandlers)

Same as put(SObjectField, Object) above, but with an additional Boolean parameter that can be set to true in order to trigger any handlers that have been added to the field.


get(SObjectField)

Object get(SObjectField fieldToken)

Returns the record’s current value of the specified field.


getRelatedRecords(String)

B25.FormRecordCollection getRelatedRecords(String relationshipName)

Returns all the records related to this FormRecord (wrapped in a B25.FormRecordCollection object) for a specific relationship name. The relationship name can be found on the lookup from the child record to the parent record. For example, to get all the reservation contacts of a reservation, the relationship name is ‘B25__ReservationContacts__r’.


getRelatedRecords(ChildRelationship)

B25.FormRecordCollection getRelatedRecords(ChildRelationship relationship)

Same as getRelatedRecords(String) above, but takes a Schema.ChildRelationship as input rather than a String. You can obtain ChildRelationships from an SObjectDescribe instance:

List<Schema.ChildRelationship> relationships = Account.SObjectType.getDescribe().getChildRelationships();

On this page

  • No labels