Homelab, Linux, JS & ABAP (~˘▾˘)~
 

[CAP] Get ID for newly created entry in a table defined with aspect cuid

https://cap.cloud.sap/docs/cds/common#aspect-cuid

https://cap.cloud.sap/docs/node.js/databases#insertresult-beta

const result = await INSERT(payload).into(table)
const newEntries = [...result]

console.log("New ID: " + newEntries[0].ID)

Leave a Reply

Your email address will not be published. Required fields are marked *