Skip to content

Min/Max-Items #857

Description

@Schmarvinius
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions