Skip to Content
0
Jan 10 at 04:00 AM

SAP CAP version 5.7.4 SELECT.one not return Associations and Compositions in payload

271 Views

I'm having an issues with SAP CAP version 5.7.4, Associations and Compositions is not returned.

For example:

let activateRequest = await cds.run(SELECT.one.from(ActivateRequest).columns(
    ((col) => {
      col('*'),
        col.activateRequestLogs((actLog) => {
          actLog('*')
        }),
        col.request((req) => {
          req('*')
        })
    })
  ).where({
    activateID: activateID
  }));

This not return the data. The activateRequest.request is null

But if I'm remove the .one, it still return the data:

let activateRequest = await cds.run(SELECT.from(ActivateRequest).columns(
    ((col) => {
      col('*'),
        col.activateRequestLogs((actLog) => {
          actLog('*')
        }),
        col.request((req) => {
          req('*')
        })
    })
  ).where({
    activateID: activateID
  }));

The activateRequest[0].request will have data.

Old version of 5.7.2 does not have this issues.