Q: 11
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?
Options
Discussion
Why use output.log instead of console.log in B or D? Looks off, pretty sure SAP uses console.log for this kind of handler.
B , since it uses .on which I usually pick for event hooks, and the basic structure looks like other CAP examples I've seen. Though the output.log instead of console.log could be legit in some custom setups. Could totally be missing something with 'after' vs 'on' here.
Man, SAP syntax always trips me up. B tbh, since it uses .on and seems close to the event concept, just not sure if the output.log is right for console logging.
A , since it's using 'after' for post-read hooks and has the correct console.log syntax. B and D use output.log which is a common trap in CAP questions. Pretty sure A matches typical CAP event handler patterns, but happy if someone spots an issue.
C vs A here, but I think A is right since it uses
after with console.log, which matches how you handle post-read events in CAP. I spotted a similar pattern in official guide examples. Anyone see another syntax that works?Maybe B here, because it uses
.on which feels right for capturing events, but that output.log instead of console.log might be a trap. Still, B is close if the handler is before the event I think. Disagree?A
Had something like this in a mock before, it's A. The event type is handled with 'after' and proper logging.
Be respectful. No spam.