English
triggerCal
About 226 wordsLess than 1 minute
2025-12-15
bizApi.triggerCal(param)
Triggers calculation. It is recommended to use triggerCalAndUIEvent whenever possible.
Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
| operateType | Calculation type: mdEdit for editing detail data, mdCopy for copying detail data, mdDel for deleting detail data, mdAdd for adding detail data, masterEdit for editing master-object data | String | Yes |
| masterData | Master-object data | Object | No |
| objApiName | Current object that initiates the calculation | String | Yes |
| details | Detail-object data | Object | No |
| parseParam | Intercepts and modifies request parameters before calculation is triggered | Function | No |
| delDatas | Deleted detail-object data | Array | Required when calculation is triggered because detail-object data was deleted |
| extraFields | Additional fields to calculate when the default fields analyzed by the framework do not satisfy business needs | Object | No |
| filterFields | Filters common calculation fields | Object | No |
| changeFields | Fields whose value changes trigger this calculation, e.g. ['price','discount'] | Array | Required when calculation is triggered by field value changes |
| noRetry | Whether retry is needed when calculation fails | Boolean | No |
| loadingText | Prompt text during calculation | String | No |
| noLoading | Do not show loading during calculation. Disabling loading may cause concurrent data issues | Boolean | No |
Return Value
Promise
Basic Example
Modify detail data
export default class Plugin {
apply() {
return [{
event: 'form.render.after',
functional: this.formRendereAfter.bind(this)
}]
}
formRendereAfter(context, plugin) {
return new Promise((resolve, reject) => {
context.triggerCal({operateType: 'mdEdit', changeFields: ['price', 'discount']}).then(rst => {
if(rst.statusCode) {
reject();
} else {
resolve();
}
})
})
}
}