cap-defaultvalue-function
Common.DefaultValuesFunction pointed at a service function: getDefaultValues() selects the highest existing ID and returns that plus one, leaving the second key element to the user.
Books has a two-part key, ID and shop, with ID annotated @readonly so nobody types it. The entity is @odata.draft.enabled, the function is declared on the service beside it and annotated as the entity's Common.DefaultValuesFunction, and its handler orders Books by ID descending, takes the first row and returns { ID: ID + 1 }, so shop stays empty. An app under app/bookshop, listed in sapux, carries the generated field group and UI.LineItem annotations. One commit, from December 2024, and the README is the CAP scaffold's own getting-started text, so the annotation and that handler are the whole of it.
Facts
Where it sits
Who is behind it
In the atlas: maintains 47, contributes to 47, wrote 10@miyasutamaintainer
What it declares
Every artifact
- Type
- Sample
- Origin
- Independently maintained
- Use as
- A reference
- Runtime
- Node.js
As a sample
- Declared for
- ^8
- Form
- does not say
Connections
Editing a record over several requests before it becomes real
Describing a service so a Fiori client renders it without UI code
Download
README
quoted from miyasuta/cap-defaultvalue-function, readGetting Started
Welcome to your new project.
It contains these folders and files, following our recommended project layout:
| File or Folder | Purpose |
|---|---|
app/ | content for UI frontends goes here |
db/ | your domain models and data go here |
srv/ | your service models and code go here |
package.json | project metadata and configuration |
readme.md | this getting started guide |
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
History in the atlas
- First seen.
For your agent
- Ref
artifact:miyasuta-cap-defaultvalue-function- JSON
- /artifacts/miyasuta-cap-defaultvalue-function.json
- MCP
- Connecting an agent