cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

EKEYTYPE: The key argument has to be of type `string` or `number`. Found: `undefined` in CAP.

Boopalan
Explorer
1,487

Hi Experts!

GoodDay!

This issue was raised in between the development (when adding attachment feature to my CAP application – used @cap-js/sdm library as mentioned in CAPIRE documentation)

Below is the structure of my header and attachment entity.

InvoiceHeader – Entity

Boopalan_0-1730193033591.png

Attachment – Entity

Boopalan_1-1730193033592.png

I’ve implemented a custom handler for InvoiceHeader entity on Update event.

Boopalan_2-1730193033594.png

I’m running my application in a hybrid mode and I’m opening my annotated UI application (built using FPM). When trying to edit a record and saving it showing me the below error.

             EKEYTYPE: The key argument has to be of type `string` or `number`. Found: `undefined`

Boopalan_3-1730193094690.png

When I’m debugging it, the error was coming from the SELECT statement (which was working previously) line no.103 like in the below screenshot. However the query executed successfully where you can see the result in aHeaders variable.

Boopalan_4-1730193094697.png

I’m sure “ID” is the only key for InvoiceHeader Entity and the value is coming via “req.data.ID” parameter.

I’m trying to figure it out, I’m not sure where I’m lagging.

Help me to resolve this issue.

Thanks in Advance!!

Best Regards

Boopalan M

SAP Business Application Studio , SAP Cloud Application Programming Model ,

SAP HANA Cloud , SAP HANA Cloud, SAP HANA database 

View Entire Topic
catano
Active Participant
0 Kudos

Hi @Boopalan ,

Could you take a look at the Serving Media Data topic in the documentation? 

entity Books { //...
  image : LargeBinary @Core.MediaType: imageType;
  imageType : String  @Core.IsMediaType;
}

Maybe that's what you are looking for instead of the attachments and sdm plugins.

Regards,
Peter