Excerpt |
---|
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.
Code Block |
---|
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');
}
} |
Code Block |
---|
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
Code Block |
---|
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.
Code Block |
---|
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.
Code Block |
---|
Object get(SObjectField fieldToken) |
Returns the record’s current value of the specified field.
Code Block |
---|
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__ReservationContactsReservation_Contacts__r’.
Code Block |
---|
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:
Code Block |
---|
List<Schema.ChildRelationship> relationships = Account.SObjectType.getDescribe().getChildRelationships(); |