English
bom.updateBomForTwiceConfig.before
About 200 wordsLess than 1 minute
2026-05-08
Execution Timing
Before updating BOM secondary configuration
Parameters
| Parameter | Description | Type |
|---|---|---|
| obj | BOM object | Object |
| rootData | Root data | Object |
| mdApiName | Metadata API name | String |
| recordType | Business type | String |
| param | Other parameters | Object |
Return Result
| Parameter | Description | Type |
|---|---|---|
| status | Whether to continue executing subsequent logic | Boolean |
Notes
- This hook is triggered before BOM secondary configuration is updated and can be used to validate or modify update parameters.
- When the returned
statusis false, the system interrupts the subsequent BOM update process. - If the returned
statusis true or is not returned, the system continues updating the BOM secondary configuration.
Code Example
export default class Plugin {
apply() {
return [{
event: "bom.updateBomForTwiceConfig.before",
functional: this.updateBomForTwiceConfig.bind(this)
},
];
}
async updateBomForTwiceConfig(context){
let { obj, rootData, mdApiName, recordType, param } = context;
// Validate whether the BOM data meets secondary configuration requirements
const isValid = this.validateBomForTwiceConfig(obj, param);
// If validation fails, return status as false to interrupt the process
if(!isValid) {
return {
status: false
};
}
// Preprocess BOM data
this.preprocessBomData(obj, param);
// Return status as true to continue execution
return {
status: true
};
}
validateBomForTwiceConfig(obj, param) {
// Custom business logic for validating BOM data
return true;
}
preprocessBomData(obj, param) {
// Logic for preprocessing BOM data
}
}