cancel
Showing results for 
Search instead for 
Did you mean: 

Can't create entity while using SUM on entity

Mikkelj
Explorer
0 Kudos

Hi Experts,

I'm trying to utilize SUM aggregation on an service entity. It works perfectly fine for getting existing entities. But when i try to create a new entity, it fails (error is in the bottom of the post).

I created a simple example:

and the service:

This is the response when i get existing:

and this is the post request that fails:

It's a requirement to be able to create the header by it self, so deep inserts is not an option. I also know i can just do this in the custom handler as well, but that's what i'm trying to avoid.

Does anyone know if there is a way to fix this?

BR

Mikkel

PS: Sorry about all the images instead of code examples -> Could not get code to format correctly...

Ajit_K_Panda
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi mikkelj1983_94 ,

I tried this locally and it works. Can you provide additional information or may be put the entire project in github and share.

Regarsd, Ajit

Mikkelj
Explorer
0 Kudos

Hi ajitkpanda

Hmm ok, here is the git: https://github.com/MikkelJ/createWithSumBug

/Mikkel

Accepted Solutions (0)

Answers (1)

Answers (1)

Ajit_K_Panda
Product and Topic Expert
Product and Topic Expert

Hi mikkelj1983_94 ,

Cloned and Tried. It works.

Regards, Ajit

Mikkelj
Explorer
0 Kudos

hi ajitkpanda,

Updating from CDS 6.4.0 -> 6.5.0 made it work for me as well, thanks for helping me out with the testing 🙂

/Mikkel