Skip to Content
0
Jun 08, 2020 at 02:13 PM

Input restrictions

193 Views

Hi guys,

I'm currently working in input validation and input restrictions. I stumbled across some interesting behavior.
It seems like that Fiori Elements uses the restrictions regarding the entity and not all restrictions in the metadata.

The property 'surname' received the restrictions from the schema.cds file.

entity People : managed, cuid {
    forename   : String not null;
    surname    : String (30) not null;
    ...
}

Which is resolved into the property restrictions in the metadata of the entity. These restrictive metadata are interpreted by Fiori Elements (displayed in the picture below).



But some of the restrictions, specially when created in the view cds file, are resulting in the metadata of the specific service. It seems that these restrictive metadata are not interpreted by fiori (in the picture above the 'Vorname' / 'forename' should also marked with an error state).

annotate plt.People with @( UI:{...}) {    
forename @( Common:{FieldControl: #Mandatory}, Validation:{Minimum: 33,Maximum: 200}, title: '{i18n>Forename}' ); };



Does somebody have expierence with the restrictions and could share their experiences?
Moreover, the 'not null' flag in the database schema does not seem to be resolved in metadata. Did somebody had it working?

Cheers,
Thorsten

Attachments

unbenannt.png (89.8 kB)
unbenannt1.png (20.0 kB)
unbenannt2.png (17.7 kB)