Skip to Content
0
Feb 04, 2020 at 05:01 PM

Custom column using not displayed field (but available in CDS)

848 Views

Hello experts,

I've created a list report, to which I've extended by adding some custom columns. The problem I'm facing is that my custom columns only work when the CDS field behind it (binded) is being displayed at the standard columns.

I.e

<Column id="ExtensionWizard::Attachments" xmlns="sap.ui.table" width="3em">
...
  <Button icon="{= ${dmsDocumentCount} === 0 ? 'sap-icon://warning' : 'sap-icon://attachment' }" 
     xmlns="sap.m" press="onDisplayAttachments"/>
...
</Column>

Displays this:

And only if I display the dmsDocumentCount column I have the desired output:

I could see that this happens because the ODATA service is not being requested to return the dmsDocumentCount field.

So your answer can go both ways:

  • How to force this field to be requested by the OData. Remember I'm extending a list report.
  • How to achieve the the result (or similar).

Thank you very much for your answers,

Regards,

Felipe Silva

Attachments

1.jpg (2.4 kB)
2.jpg (3.7 kB)