English
md.copy.before
About 172 wordsLess than 1 minute
2025-12-15
This hook is triggered before copying child-object data, including batch copy. It allows extra business actions before copying, including but not limited to intercepting the copy action.
- Intercept copying child-object data
Parameters
| Parameter | Description | Type |
|---|---|---|
| Common parameters | See details | -- |
| objApiName | Child object apiName | String |
| recordType | Child object record type | String |
| copyRowIds | Row IDs of the child-object data being copied | Array |
Return Value
None
Basic Example
Intercept copying child-object data
export default class Plugin {
apply() {
return [{
event: 'md.copy.before',
functional: this.mdCopyBefore.bind(this)
}]
}
// If this is a middleware plugin in a vcrm project, swap the interaction parameter positions
// mdCopyBefore(plugin, context)
mdCopyBefore(context, plugin) {
// todo what you want
}
}Notes
1. Child-object data obtained through context APIs in this hook does not include the newly copied data
When context APIs are used in this hook to get object data, the new copied data is not immediately reflected in the object data returned by the APIs.
