...
Code Block |
---|
void customize(B25.Form form) |
Parameters:
Name | Type | Description |
---|---|---|
form | B25.Form | The form, to which you can add your own handlers. |
...
Methods
getField
Code Block |
---|
B25.FormField getField(SObjectField fieldToken) |
This method will return a Field object for the specified SObjectField. The SObjectField must be an existing reservation field.
Return value:B25.FormField
Parameters:
Name | Type | Description |
---|---|---|
fieldToken | The token representing the field for which you want to get a FormField instance. |
Example:
Code Block |
---|
B25.FormField titleField = form.getField(B25__Reservation__c.B25__Title__c); |
...
getButton
Code Block |
---|
B25.FormButton getButton(String buttonName) |
This method will return a Button object. The buttonName must be an existing button.
Return value: B25.FormButton
Parameters:
Name | Type | Description |
---|---|---|
buttonName | String | The name of the button to interact with. |
Example:
Code Block |
---|
B25.FormButton button = form.getButton('my-custom-button'); |
...
getSection
Code Block |
---|
B25.FormSection getSection(String sectionName) |
...
Return value:B25.FormSection
Parameters:
Name | Type | Description |
---|---|---|
sectionName | String | The label of the section to interact with. |
Example:
Code Block |
---|
B25.FormSection section = form.getSection('Pricing'); |
...
Return value:B25.Lookup
Parameters:
Name | Type | Description |
---|---|---|
fieldToken | The token representing the lookup for which you want to get a FormField instance. |
Example:
Code Block |
---|
B25.Lookup resourceLookup = form.getLookup(B25__Reservation__c.B25__Resource__c); |
...
Return value:B25.RelatedList
Parameters:
Name | Type | Description |
---|---|---|
sObjectToken | The token representing the child object type for which you want to get a RelatedList instance. |
Example:
Code Block |
---|
B25.RelatedList contactList = form.getRelatedList(B25__ReservationContact__c.SObjectType); |
...
This method is a convenience method, and is identical to calling onInit().add(B25.FormEventHandler handler)
. See the previous section onInit (without parameters) for more details.
Parameters:
Name | Type | Description |
---|---|---|
handler | The handler to trigger when the form is initialized. |
...
onBeforeSave (without parameters)
...
This method is a convenience method, and is identical to calling onBeforeSave().add(B25.FormEventHandler handler)
. See the previous section onBeforeSave (without parameters) for more details.
Parameters:
Name | Type | Description |
---|---|---|
handler | The handler to trigger when the form is saved (before performing the actual save logic). |
...
addButton
Code Block |
---|
void addButton(B25.FormButton button) |
Adds a button to the form. Must be called inside the customize method.
Parameters:
Name | Type | Description |
---|---|---|
button | The button to be added to the form. |
Example:
Code Block |
---|
form.addButton(new B25.FormButton('my-name', 'My Label')); |
...
Shows a success toast notification on the form.
Parameters:
Name | Type | Description |
---|---|---|
title | String | The title to be displayed on the toast notification. |
message | String | The message to be displayed on the toast notification. |
Example:
Code Block |
---|
form.showSuccessToast('Success!', 'Changes saved succesfully.'); |
...
Shows an error toast notification on the form.
Parameters:
Name | Type | Description |
---|---|---|
title | String | The title to be displayed on the toast notification. |
message | String | The message to be displayed on the toast notification. |
Example:
Code Block |
---|
form.showErrorToast('Error', 'Something went wrong.'); |
...
Shows a warning toast notification on the form.
Parameters:
Name | Type | Description |
---|---|---|
title | String | The title to be displayed on the toast notification. |
message | String | The message to be displayed on the toast notification. |
Example:
Code Block |
---|
form.showWarningToast('Warning', 'Saving this record would result in a conflict.'); |
...
Shows an info toast notification on the form.
Parameters:
Name | Type | Description |
---|---|---|
title | String | The title to be displayed on the toast notification. |
message | String | The message to be displayed on the toast notification. |
Example:
Code Block |
---|
form.showInfoToast('Did you know?', 'In order to maintain air-speed velocity, a swallow needs to beat its wings forty-three times every second.'); |
...