Default value of field should be defined in data model

Hi everyone,

I see that the default value of field is now defined in UI model!

And:

  • We don’t always have filed displayed on UI,
    • Our project (<PROJECT_NAME>) work around to listen on another field (which is displayed on UI) changed, to set this field value → does not scale well,
  • UI model which is just ONE of representation of document, a document might be consumed by another client (third-party service…).

My suggestion, that on data model we could init default value, and also ui model too.
When generate empty document:

  • First, the generator look into field configuration in data model,
  • Second, the generator look into field configuration in ui model (if there is a UI model),
  • The configuration on ui model wins :wink:

Cheers,
Trinh.

hi @trinh-wintry-peat could you create requirement to A12 and put your business cases there? Thank you.

I fully support your request :slight_smile: and I think we only have it in the UI model for historical reasons.

Note however that sometimes you don’t have the form model or you don’t know it. Then your fallback would’nt work - but it’s optional anyways so no big deal :slight_smile:

Hi @tuan-stable-gale and @baschir-loud-bluff,

I created an A12 ticket: <INTERNAL_LINK>