cancel
Showing results for 
Search instead for 
Did you mean: 

CAPM - Query

dharikrishna
Explorer
0 Kudos

Hello Experts,

What's the issue with below CAPM - Query, i am not getting the count of records.

var sparePartInvoiceCount = await SELECT.one.from ('COM_ABC_INVOICE').columns('count(*) as TotalCount').where({INV_TYPE:'Spare Part Invoice'})
result, i get after executing above query is {} (Empty json)
Please let me know, what is the problem with the query
dharikrishna
Explorer
0 Kudos

gregorw : Please advice

lars_lutz
Explorer
0 Kudos

Can you provide your schema.cds and the output of cds v.

Accepted Solutions (0)

Answers (1)

Answers (1)

martinstenzig
Contributor
0 Kudos

I just checked your statement against a table I have and it works fine. You probably have to provide more details to determine why the result is empty...

One idea though. If you have a namespace in the data model called com.abc and Invoice is your entity name. Try changing your string in the from clause to 'com.abc.Invoice' the conversion to _ is done in the framework.