Lookup Field
Adding component
Virtual input field: Adding virtual fields to the form
Source object field: Adding data source fields
Component properties
Ignore Permissions - loads all available records to the lookup search including those that are not available due to user permissions.
Object Lookup Properties:
Source Type - specify type of the Data Source. It can be sObject or Apex. Select "Apex" to use DataProvider (see below)
Field - (available for sObject Source Type) - choose field of Data Source object that will be used to display lookup option items
Size - (available for sObject Source Type) - limits lookup options list to the specified number of records
Virtual lookup properties:
Source Type - choose source type for the lookup. Can be sObject, Apex or JSON.
Use sObject Source Type to search for records in Sales Force.
Source Object - choose source object for the lookup
Field - choose field that will be used to display lookup option items
Size - limits lookup options list to the specified number of records
Default Value - provide default value if needed
Use Apex Source Type to get lookup using DataProvider.
Select JSON Source Type to build lookup options using JSON array (see below).
Apex Data provider
Data Provider allows to populate lookups/lists with custom data collected in apex class.
Allows to populate lookups with custom data collected in apex class. The needed Apex class must:
implement
FLX_KB.KanBanInterfaces.FormBuilderApiInterface Interface
have 2 public methods:
loadListData, loadLookupData
An example of such class is attached below:
To use Apex as Data Provider:
Select "Apex" in Source Type
Click "Settings" icon (1) and select an Apex class (in case of example above class is named FLX_KB_DataProvidersExample)
Add Parameters, if your class needs them (2)
JSON
Built-in data provider allows to feed JSON data to the lookup field. With this feature user can populate a lookup without interaction with database or using Apex code, and manipulate data that is not stored anywhere.
To use JSON as Data Provider:
Select "JSON" in Source Type
Click "Settings" icon (3) and type/paste a JSON code in popup appeared (4)
Enter a JSON Array. Each entry of a JSON array should contain the following properties:
id - id of record to be related to
name - text to be displayed (that should represent proper record)
The list from example above will look this:
Virtual Input lookup default value
Choose input lookup Source Object and fill in default value with source object id. It can be both string or merge field.
NOTE: Source object of test form is Account.
For lookups with Apex Data Provider and JSON Source Type default value should be one of ID values - lookup will show the "Name" property value corresponding to default ID (8, 9). Default ID can be taken from merge field.
To provide Default Value for JSON use lookup Option Id (8; e.g., "id1", so in example above it will be passed as Default Value):
This will result in:
Lookup conditions
User can define lookup filters using Conditions feature (for Source Type: sObject).
Adding filters for lookup field
1. Click Lookup component (10) on a canvas.
2. Click Conditions (11).
Provide parameters for filtering
Values should be passed in the format of where clause of SOQL query e.g. using fields API names and SOQL operators.
4. Save your changes.
5. Run the form preview.
Only active accounts with the phone not blank are displayed in dropdown list (12):
Validation rules: Input text validation rules
Events: Form Input Events
Conditional styles
This component has following conditional styles available:
hide
show
required
disable
clear
Last updated