Hi experts!
I have a question with regards to calling default actions in SAP CAP event handlers. The documentation provides that you can call actions using the syntax
srv.on('firstMethod', (req,next) => { const otherService = cds.connect.to('OtherService'); otherService.secondMethod({...}); });
In my project, I would like to call a couple of default actions (draftPrepare and draftActivate) used by Fiori Elements draft handling. However, the following code does not seem to work
srv.on('firstMethod', (req,next) => { const otherService = cds.connect.to('OtherService'); otherService.draftPrepare({...}); });
It seems like there is some issue with the request not being properly passed to the draftPrepare action, is there some way of achieving this? And in general, is it possible to call default methods using the syntax provided above? Any help would be much appreciated!
Best regards,
Jibbril