English
price-service.batchAddAfter.before
About 177 wordsLess than 1 minute
2026-05-08
Execution Timing
After data is added, determine whether the pricing service should be executed
Parameters
| Parameter | Description | Type |
|---|---|---|
| lookUpApiName | Lookup API name | String |
| isFromProductOrPriceBook | Whether the data comes from a product or price book | Boolean |
| param | Other parameter object | Object |
Return Result
| Parameter | Description | Type |
|---|---|---|
| isDoPriceService | Whether the pricing service needs to be executed | Boolean |
Notes
- This hook is triggered after data is added from another object and before determining whether the pricing service should be executed.
- It can be used to determine whether to execute the pricing service based on specific business logic.
- When the returned
isDoPriceServiceis true, the system executes the pricing service. - If the returned
isDoPriceServiceis false, the pricing service is skipped.
Code Example
export default class Plugin {
apply() {
return [{
event: "price-service.batchAddAfter.before",
functional: this.batchAddAfterBefore.bind(this)
},
];
}
async batchAddAfterBefore(context){
let { lookUpApiName, isFromProductOrPriceBook, param } = context;
// Determine whether the pricing service should be executed based on different source APIs
let needPriceService = false;
// Return whether pricing is required based on business logic
return {
isDoPriceService: needPriceService
};
}
}