cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with annotation "cds.on.insert "

Rwitte
Participant
0 Kudos
553

Hello,

I am facing currently an issue with the annotation "@cds.on.insert". As can be seen in the code below I am using it to fill the property userAttribute of the entity Foo on creation with a specific attribute of the pseudo variable user.

entity Foo : cuid, managed {
    userAttribute : String @cds.on.insert : $user.attr;
}

When running it locally the response of the POST request contains correctly the assigned value. However, when retrieving later on the dataset the field "userAttribute" is empty and ofc the field is also empty on the sqlite DB.

Shouln't this work out of the box or have I gotten the documentation wrong?

Best regards,
Raphael

View Entire Topic
falcaraz
Explorer
0 Kudos

According to this, I'd say it's not supported without some extra configuration on your part

mattredfig
Participant
0 Kudos
Hi - do you know where that documentation went? that #users header doesn't exist on the page you linked any longer.