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

A wrapper around a collection of B25.FormRecords, with some additional methods to manipulate the collection.

This class implements the Iterator interface.

Example

The following code demonstrates adding a reservation contact from inside an B25.FormEventHandler

B25.FormRecord record = form.getActiveRecord();
B25.FormRecordCollection reservationContacts = record.getRelatedRecords('B25__Reservation_Contacts__r');
Id contactId = [SELECT Id FROM Contact LIMIT 1].Id; // just grab a random contact id for this example
Id reservationId = record.getSObjectClone().Id;
reservationContacts.add(new B25__ReservationContact__c(
    B25__Contact_Lookup__c = contactId,
    B25__Reservation_Lookup__c = reservationId
));

Methods

get(String)

B25.FormRecord get(String UUID)

Gets the record from the collection with the specified identifier.

Return value: B25.FormRecord

Throws: B25.FormRecordCollectionException if the collection does not contain a record with the specified identifier.


remove(B25.FormRecord)

void remove(B25.FormRecord toRemove)

Removes the specified B25.FormRecord from the collection.


add(SObject)

B25.FormRecord add(SObject recordToAdd)

Wraps the given SObject record in a B25.FormRecord, adds it to the collection, and returns the wrapped record.

Return value: B25.FormRecord

Throws: B25.RelatedListItem.SObjectTypeException if record being added does not match the SObjectType of this collection.


iterator()

Iterator<B25.FormRecord> iterator()

Returns an iterator over the wrapped B25.FormRecords for this collection.

Return value: Iterator

On this page

  • No labels