English
object_reference
About 254 wordsLess than 1 minute
2025-09-22
Lookup single-select / multi-select fields are triggered in the field.edit.before stage, before the object picker is opened.
- Intercept add actions at this stage
- Process the input parameters of the object picker
- Replace the object picker
Parameters
| Parameter | Description | Type |
|---|---|---|
| fieldName | api_name of the field that triggered the event | String |
| objApiName | api_name of the object that triggered the event | String |
| dataIndex | dataIndex of the record that triggered the event, used for detail-object data | String |
| selectObjectParams | Parameters that will be used to open the object picker. These can be modified in the plugin | Object |
Key properties of selectObjectParams
| Parameter | Description | Type |
|---|---|---|
| isSingle | true for single-select, false for multi-select | Boolean |
| filters | Filter conditions | Array |
| wheres | Filter conditions | Array |
| disableAdd | true disables creating new records from the picker list | Boolean |
Return Value
| Parameter | Description | Type |
|---|---|---|
| consumed | true means subsequent logic will not continue | Boolean |
| selectObjectParams | Parameters that will be used to open the object picker | Object |
| selectObject | Object-selection method (async). The plugin handles the selection logic and returns the selected data. Multi-select is supported | Function |
Code Example
Filter available selectable data:
{
event: "field.edit.before",
functional: function (pluginExecResult, options) {
let {selectObjectParams}=options;
selectObjectParams.filters = (selectObjectParams.filters||[]).push({
field_name:"name",
field_values:["Red"],
operator: "LIKE"
})
return {selectObjectParams}
}
}Implement the selection control in the plugin and replace the default picker:
{
event: "field.edit.before",
functional: function (pluginExecResult, options) {
let selectObject = async function(params){
let objectDataList=[]
return {objectDataList}
}
return {selectObject}
}
}Notes
- Calling
dataUpdaterto update data in this event is not suitable.
