Notifications
Clear all
Topic starter
You want to implement an event handler to show a console log once a supplier record is read.
What is the correct syntax to implement this?
- A . const cds = require('@sap/cds')module.exports = cds.service.impl(function () { const {Supplier} = this.entities() this.after('each',Supplier, row =>{ console.log(`Read Supplier: ${row.ID}`)})})
B. const cds = require('@sap/cds')module.exports = cds.service.impl(function () { const {Supplier} = this.entities() this.after('each',Supplier, row =>{ output.log(`Read Supplier: ${row.ID}`)})})
C. const cds = require('@sap/cds')module.exports = cds.service.impl(function () { const {Supplier} = this.entities()this.on('each',Supplier, row =>{ output.log(`Read Supplier: ${row.ID}`)})})
D. const cds = require('@sap/cds')module.exports = cds.service.impl(function () { const {Supplier} = this.entities() this.on('each',Supplier, row =>{ console.log(`Read Supplier: ${row.ID}`) })})
Suggested Answer: C
Posted : 17/11/2022 2:45 am