Fixes and improvements

This commit is contained in:
Uwe Klinger
2021-05-05 11:14:02 +02:00
parent 278258c436
commit c4bee1f09a
2 changed files with 6 additions and 20 deletions

View File

@@ -1,10 +1,11 @@
const cds = require('@sap/cds');
module.exports = cds.service.impl(async function (srv) {
module.exports = cds.service.impl(function () {
const { A_BusinessPartner } = this.entities;
srv.after('UPDATE', A_BusinessPartner, data => {
// TODO: Take over the original S/4 event definition
this.after('UPDATE', A_BusinessPartner, async data => {
console.log(`>>> BusinessPartner updated ${data.BusinessPartner}`);
srv.emit("A_BusinessPartner.Changed", { businessPartners: [ data.BusinessPartner ] });
await this.emit("A_BusinessPartner.Changed", { businessPartners: [ data.BusinessPartner ] });
});
});