DEFAULT value acts as "Value if NULL"

When experimenting with the Default Value for an attribute I noticed that it behaves like “Value if Null”, that is if I delete the value in my instance CS automatically sets the value to the Default.

Example:

  1. For a DEMO asset type I defined a Number attribute COST with the default value 12.
  2. Create a new DEMO instance A
    COST = 12
  3. Change A for COST = 14, save
    COST = 14
  4. Change A, delete value in COST, save
    COST = 12

The same happens for a Classification attribute and for a String attribute.
Not one of the tests I used I set the “Required” to true.

Is this the expected behaviour?

Yes it works as designed.

The default values are created for the asset in the database level. When we tried to leave it as empty, the default value occupies the value.

If this behavior needs to be changed, then please create a feature request in brainstorm.

Thank you,
Karthik S

1 Like