How to define default value for an attribute?

Posts   
 
    
horo
User
Posts: 41
Joined: 01-Sep-2005
# Posted on: 04-Aug-2006 15:42:26   

Hi to All,

Sorry if I missed something, but is there any way to define a default value for an attribute in design?

I mean that after creating a new entity I would like to be initialized its attributes (properties) to entity / attribute level defined default, for example .City == "London"

Is the only way to do this in Factory programmatically?

thx for answers

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 04-Aug-2006 16:03:32   

There is no way to do that in the designer to my knowledge. There are probably several ways to do that programmatically: in the factories as you mentioned, or by using a type converter to a custom type and/or using the TypeDefaultValue class generated.

But probably that's something you should define in the DB instead. Please refer to the section "Entities, NULL values and defaults" in the manual for more details.

Hope that helps