English
price-service.todoAfterFieldChange.before
About 164 wordsLess than 1 minute
2026-05-08
Execution Timing
Before processing after a field change, control whether pricing should be triggered
Parameters
| Parameter | Description | Type |
|---|---|---|
| param | Parameter object containing field-change related information | Object |
Return Result
| Parameter | Description | Type |
|---|---|---|
| isNoTriggerChange | Whether not to trigger pricing | Boolean |
Notes
- This hook is triggered before processing after a field change and can be used to control whether the subsequent change flow is executed.
- If the returned
isNoTriggerChangeis true, the subsequent change flow is not triggered and the process returns directly. - It can be used to block price calculation or related field change flows under specific conditions.
Code Example
export default class Plugin {
apply() {
return [{
event: "price-service.todoAfterFieldChange.before",
functional: this.todoAfterFieldChange.bind(this)
},
];
}
async todoAfterFieldChange(context){
let { param } = context;
// Determine whether subsequent changes should be triggered based on business logic
let isNoTriggerChange = false;
// Example: if certain specific conditions are met, do not trigger changes
if(param.changeData['xxxx']) {
isNoTriggerChange = true;
}
// Return the control result
return {
isNoTriggerChange
};
}
}