Showing results for 
Search instead for 
Did you mean: 

HANA XS Advanced: New CD&S Entity (Local SQLite) + Node.js -> implement action | function in service

recently found out that CDS has now become CD&S. Made this wonderful tutorial

Everything is working. I want to add function or action in the following service

using my.bookshop as my from '../db/data-model';

service Catalog2Service {
  entity Books @readonly as projection on my.Books;
  entity Authors @readonly as projection on my.Authors;
  entity Orders as projection on my.Orders;

// How to implement ?
  action applyProductDiscount ( productID:Integer, reason:String );
  function getApprovalStatus(customerID:Integer) returns Boolean;

The official documentation contains an example for JAVA annotations

How to implement it for node.js in new cd&s?

in .on() method?

    srv.on( 'applyProductDiscount', function(){

    srv.on( 'getApprovalStatus', function(){

None of them works.

Can not find the example for local SQLite in node.js. (with cds console app)


Not interested in Cloud Hana example in Node.js module with express

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

just send POST request instead of GET 🙂

everything is working

Answers (0)