English
md.batchAdd.before
About 186 wordsLess than 1 minute
2025-12-15
This hook is triggered before selecting related object data during batch creation of child-object data. It allows extra business actions before selection, including but not limited to intercepting batch creation and customizing object selection.
- Intercept batch creation of child-object data
- Customize the object selection list
Parameters
| Parameter | Description | Type |
|---|---|---|
| Common parameters | See details | -- |
| objApiName | Child object apiName | String |
| recordType | Child object record type | String |
| lookupField | Field metadata of the lookup field used when creating the child object | Object |
Return Value
| Parameter | Description | Type | Default |
|---|---|---|---|
| beforeRequest | Hook before querying the related object data list | Function | -- |
Basic Example
Intercept batch creation of child-object data
export default class Plugin {
apply() {
return [{
event: 'md.batchAdd.before',
functional: this.mdBatchAddBefore.bind(this)
}]
}
// If this is a middleware plugin in a vcrm project, swap the interaction parameter positions
// mdBatchAddBefore(plugin, context)
mdBatchAddBefore(context, plugin) {
return new Promise((resolve, reject) => {
resolve();// if you want to intercept the add action, call reject()
})
}
}Notes
1. This hook is triggered before object selection, so no new data has been generated yet
