Showing results for 
Search instead for 
Did you mean: 

Define an implementation for a new function into a multitenancy app extension on SAP CAP

0 Kudos

Hi ,

I have some issue when I try to extend a multitenant application into SAP CAP when I try to implement a new function.

Is good to know that I am using @sap/cds-mtxs library.

I already have deployed a multitenant app that was activated from a subscriber subaccount.

Also I was able to build and activate an extension app that add two new fields for an entity. Code below:

extend Sales with { // 2 new fields.... 
x_priority : String enum {high; medium; low} default 'medium'; 
x_salesRegion : String(44);

Now I am trying to add a new function to the service and implement it

extend service CatalogService with { 
function x_func() returns String;

Function implementation:

const cds = require("@sap/cds");
module.exports = cds.service.impl(async function (service) { this.on("x_func",async(req)=>{ return "Hello!"; }); });

After activating the extension and test the function x_func() on the subscriber I receive the following error message

Not sure if is possible to implement a function into a extension app and how.

Guide that I followed is here:

Active Contributor

Hi Mihai,

in the last CAP Customer Roundtable christian.georgi presented the latest improvements on the @sap/cds-mtxs library. The question if also custom code can be part of an extension. Right now this is not supported. Maybe Christian can share some insights when this will be possible.

Best Regards

Accepted Solutions (0)

Answers (1)

Answers (1)

Active Contributor
0 Kudos

I’m not sure but in this example prepend is used:

Maybe you can have a look into this example?