cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic entity creation in SAP CAP

former_member643578
Participant
0 Kudos
830

Hello All,
I have requirement creation of dynamic entity. Firstly user will send name( i.e. entity name) like below object from UI.

{entityName: "Sample",entityDescription: "SampleEntity"}

By using above data I need to create in entity in Backend Service. After this I will send table fields like below object from UI.

{

  name: "sample",

  description: "",

  fields: [

    {

      name: 'userId',

      description: '',

      default_val: '',

      type: 'Text',

      unique: '',

      nullable: '',

    },

    {

      name: 'userName',

      description: '',

      default_val: '',

      type: 'Text',

      unique: '',

      nullable: '',

    }

  ]}

By using above data I need to create fields in entity.
Final output what I have to get in src/db folder

entity sample {  

key userId: string , 

userName: string

}

Is this possible in SAP CAPM?. Please help me

View Entire Topic
vLeonkev
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Vasundhara,

Try the cds watch command if it fits your needs.

Best,

Vladislav

former_member643578
Participant
0 Kudos

Actually I forgot to tell one thing I am using PostgreSQL as Database using Node JS with typescript. So I can't run cds watch for my requirement.