English
md.edit.after
About 182 wordsLess than 1 minute
2025-12-15
This hook is triggered after editing child-object data, specifically after input blur, and before UI events/calculation logic are executed. It allows extra business actions, including but not limited to modifying main and child object field values.
- Modify field values of the main object and child objects
Parameters
| Parameter | Description | Type |
|---|---|---|
| Common parameters | See details | -- |
| objApiName | Child object apiName | String |
| recordType | Child object record type | String |
| dataIndex | Row IDs of the edited child-object data (example) | Array |
| fieldName | Edited field (example) | String |
| changeData | Changed field data (example) | Object |
Return Parameters
None
Basic Example
Using parameters
export default class Plugin {
apply() {
return [{
event: 'md.edit.after',
functional: this.mdEditAfter.bind(this)
}]
}
// If this is a middleware plugin in a vcrm project, swap the interaction parameter positions
// mdEditAfter(plugin, context)
mdEditAfter(context, plugin) {
const { dataIndex, changeData, fieldName } = context;
dataIndex.forEach(rowId => {
const newValue = changeData[rowId][fieldName]; // value after field change
console.log(newValue);
// If you want to modify data, directly modify changeData
// changeData[rowId].xxx = 'test'
});
}
}