English
nonstandard_product.checkUnit.before
About 135 wordsLess than 1 minute
2026-05-08
Execution Timing
Before checking product units
Parameters
| Parameter | Description | Type |
|---|---|---|
| changeRows | Changed row data | Array |
| param | Other parameter object | Object |
Return Result
| Parameter | Description | Type |
|---|---|---|
| stop | Whether to stop executing subsequent logic | Boolean |
Notes
- This hook is triggered before product units are checked and is used to verify whether the changed product unit is consistent with the original product unit.
- If they are inconsistent, the user can be prompted and can choose to cancel the operation.
- If the returned
stopis true, unit validation logic is stopped. - If the returned
stopis false or is not returned, subsequent logic continues.
Code Example
export default class Plugin {
apply() {
return [{
event: "nonstandard_product.checkUnit.before",
functional: this.checkUnit.bind(this)
},
];
}
checkUnit(context){
let { changeRows, mdApiName, lookupData, plugin, param } = context;
if(!lookupData) return;
return { stop: false };
}
}