Skip to Content
0
Jan 27, 2022 at 10:47 PM

Switch boolean values in annotations

515 Views Last edit Feb 16, 2022 at 09:39 AM 4 rev

Hi Experts!

Original question below, however it has been updated to include the SAP Fiori Elements tag since the solution is most likely frontend related. For reference as to why, please look at the comments.

I have a simple question. When using any annotation that takes a boolean, is there a way to swap boolean values in the annotation itself? So

annotate MyService.MyEntity with @(
    Capabilities.DeleteRestrictions: {
        Deletable: !ShouldNotBeDeletable // Something like this
    }   
)

In my project I need to reverse several booleans in this manner, I could always create an opposite boolean in the model, but seems very redundant.

Best Regards,

Jibbril