0
 Followers
4
 Likes

Add new Attribute to Entity with Default Value

Backend
New

When adding a new Attribute to an existing Entity it would be useful to specify a default value that the new Attribute is initialised with on each existing record.

This would save time rather than bootstraping the whole Entity.

Created on 2 May
Comments (6)

JR,

There is already a default value for the attribute in the Entity.


Best regards,

Abílio Matos


Hi Abílio, the default value above does not update the existing records in the entity with the value specified. I believe this default is only used when the field is left empty on a create or update action. So I would have to write a special process to go through each existing record and update it.

The idea is that a simple right click and add new attribute action could apply the default data to existing data in the entity and save it, so you get off to a quick start with the new attribute.

Regards, John.


Changed the category to Service Studio


Changed the category to Backend


Hi JR,

You don´t have to do a special process, just do an update on sql advancequery.

Something like this after publish the new Attribute 

Update <tableName> 

set <newAttribute> = <defaultValue>

Commit;


BestRegards,

Frederico

Thanks Frederico, that's a handy short cut!

views
451
Followers
0