Skip to Content

Prevent editing of key value in Fiori Elements object page

Hi,

I have created a CDS view, generated a Business Object for it, exposed it via an OData service using annotations, and created a Fiori Elements List Report application based on this service.

When I run the application, navigate from the List Report to the Object Page and go into Edit mode, the field specified as the key is open for input, even though changes to this field are not saved to the database (as you would expect: you can't change the key value in SM30, you have to copy the original and then delete it).

Is there a UI (or similar) CDS annotation I can use to prevent the key being open for input when editing the Object Page?

Thanks,

Andrew

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 27 at 01:12 PM

    I have found the answer. It is not possible to get this behaviour by using CDS annotations alone, but it can be achieved programmatically in the Business Object that gets generated by the CDS annotations:

    https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/1709.001/en-US/ff67efc37b154f1e88a2f44d26eb2cf0.html

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 13 at 02:46 PM

    Hello Andrew,

    You can use @ObjectModel.readOnly:true.

    Regards,

    Pratheek

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Andrew,

      This is an OData behavior and I don't think this should be handled "differently" by FIORI.

      As an example, you can check CDS "C_PurchaseReqnHeader"

      Regards,

      Pratheek