extend my.Incidents with {
@Validation.MaxItems : 20
@Validation.MinItems : 2
attachments: Composition of many Attachments;
}
The values are not necessarily an int. Apps could also specify a property from the entity which contains the amount or a dynamic expression, e.g. @Validation.MinItems : (stock > 20 ? 2 : 0)
Apps need to be able to override the error message. Use Fiori elements approach where the I18n key is appended with the entity name / property to override the error message for a specific property.
Make sure that the error message correctly targets the table. And make sure that during draft it is only a warning and only on save an error because draft allows an invalid state by concept.
Handlers to register for max / min items:
- CREATE/UPDATE - active instance
- Check for nested compositions and against attachment count passed in the payload --> throw warn if in draft mode otherwise error out
The values are not necessarily an int. Apps could also specify a property from the entity which contains the amount or a dynamic expression, e.g.
@Validation.MinItems : (stock > 20 ? 2 : 0)Apps need to be able to override the error message. Use Fiori elements approach where the I18n key is appended with the entity name / property to override the error message for a specific property.
Make sure that the error message correctly targets the table. And make sure that during draft it is only a warning and only on save an error because draft allows an invalid state by concept.
Handlers to register for max / min items: