From c16dc0d2b4e910001b1dd624382f6132ed10863b Mon Sep 17 00:00:00 2001 From: Marten Schiwek Date: Thu, 13 Nov 2025 16:51:27 +0100 Subject: [PATCH 1/2] Hint about limitations of cds.model Hi colleagues, in multi-tenant scenarios cds.context.model must be used at runtime instead of cds.model to ensure the model includes the tenant specific feature flags and extensions. The PR adds a hint for this. to `cds.entities` and `cds.model` BR, Marten --- node.js/cds-facade.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index 71366a97c..0e0630ac0 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -185,6 +185,8 @@ Known values for `cds.cli.command` are `add`, `build`, `compile`, `deploy`, `imp Is a shortcut to `cds.model.entities`. Used as a function, you can [specify a namespace](/node.js/cds-reflect#entities). +Be aware of the limitations of [`cds.model`](cds-facade#cds-model) + ### cds. env {.property} Provides access to the effective configuration of the current process, transparently from various sources, including the local _package.json_ or _.cdsrc.json_, service bindings and process environments. @@ -297,6 +299,9 @@ cds.model = await cds.load('*') [Learn more about bootstrapping in `cds.server`.](./cds-serve){.learn-more} +::: danger Limitations of `cds.model` +`cds.model` is just the base model of the application. In multi-tenant scenarios tenants might [extend](../@external/guides/extensibility/index.md#extensibility) the model or parts of the model are put behind [feature flags](../@external/guides/extensibility/feature-toggles.md) and thus `cds.context.model` must be used at runtime to lookup the actual model used by the tenant. +::: ### cds. app {.property} From 55813e4782371621145cc67409cda6e93db84256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jeglinsky?= Date: Tue, 25 Nov 2025 13:32:42 +0100 Subject: [PATCH 2/2] Apply suggestions from code review --- node.js/cds-facade.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node.js/cds-facade.md b/node.js/cds-facade.md index 0e0630ac0..e3fb3dfc3 100644 --- a/node.js/cds-facade.md +++ b/node.js/cds-facade.md @@ -185,7 +185,7 @@ Known values for `cds.cli.command` are `add`, `build`, `compile`, `deploy`, `imp Is a shortcut to `cds.model.entities`. Used as a function, you can [specify a namespace](/node.js/cds-reflect#entities). -Be aware of the limitations of [`cds.model`](cds-facade#cds-model) +Be aware of the limitations of [`cds.model`](cds-facade#cds-model). ### cds. env {.property} @@ -300,7 +300,7 @@ cds.model = await cds.load('*') ::: danger Limitations of `cds.model` -`cds.model` is just the base model of the application. In multi-tenant scenarios tenants might [extend](../@external/guides/extensibility/index.md#extensibility) the model or parts of the model are put behind [feature flags](../@external/guides/extensibility/feature-toggles.md) and thus `cds.context.model` must be used at runtime to lookup the actual model used by the tenant. +`cds.model` is just the base model of the application. In multitenant scenarios tenants might [extend](../guides/extensibility/) the model or parts of the model are put behind [feature flags](../guides/extensibility/feature-toggles) and thus `cds.context.model` must be used at runtime to lookup the actual model used by the tenant. :::