Change stored value of an attribute by end-user

0
I have an entity 'Contract' with an attribute 'Max. Tarief Piek'. The stored value is 0.18. Once in a while that stored value needs to change. But only for all coming new  'Contracts', not for the ones allready made. The new value will stay the same for months. Of course the end-user can overwrite the stored value, but the end-user needs to do this for months. Or I can change the stored value, but that's a lot work, because I have to make a new release, just for changing the stored value.   So I was trying to make a pop-up page, where the end-user can change the stored value himself. But, als earlier mentioned, only for the new coming contracts. Not for excisting contracts. So I cannot specify a contract where the attribute is belonging to. I get the following message:   My question is: Is it possible that an end-user can change a stored value in the domain model, without changing previous objects in that entity?  
asked
2 answers
0

You could make a Configuration entity, let the Administrator (or whichever role) maintain the value of this. Upon creating a new Contract object, you copy the value stored within the Configuration entity to 'Max. Tarief Piek'

answered
0

Hi Christine,

 

If I understand correctly you would like to provide the users the ability to change an attributes default value? As you may have guessed you would not use a stored default value on the attribute in the domain model anymore.

 

This method lets your users have full control, without need for redeployments to change default:

 

First create an entity + attribute to hold default values that the user and view and edit (you can name it what you want):

image.png

 

You will want to create one object of this entity, and only one. Then you can expose this to the users via a new edit page, so that they can control it. 

 

Next, on your original entity that holds the original "Max. Tarief Piek" you can add an after create event handler where you retrieve the default setting object you created previously, and set the "Max. Tarief Piek" attribute with the default from your default setting. This will allow you to change the defaults in the future without affecting previous.

answered