Page 1 of 1
Why does the default value for a property not appear in when inserting via ED Grid?
Posted: Wed 24 Apr 2013 23:46
by EdB
Hi,
I have setup a default value for a property of an entity ie Type="test". However when I append the row in the grid and CTRL-S, this default is not used? Is this a bug?
I am trying to test the Entity and how it behaves against the DB without writing MVC code.
Thanks.
Re: Why does the default value for a property not appear in when inserting via ED Grid?
Posted: Thu 25 Apr 2013 09:53
by EdB
Hi,
Now sorted. One has to use the default value setting for the Storage property as opposed to the Class Property. Then inserting rows via "Retrieve data" will use this default and enter into DB
Re: Why does the default value for a property not appear in when inserting via ED Grid?
Posted: Thu 25 Apr 2013 11:13
by EdB
OK, I am confused again. It seems that there is a bug here in that "Retrieve Data" does not respect string default values, no issue with INTS. With INTS one can just setup up the default value on the class and it works a treat. With String, nothing.... just (null).
Thoughts.
Re: Why does the default value for a property not appear in when inserting via ED Grid?
Posted: Thu 25 Apr 2013 11:43
by EdB
Hi,
OK, I have found it. I think this can be described as a very undocumented feature in ED. The answer is to use single quotes around the string ie 'XXX', not "XXX" or XXX. So it seem that this value is passed straight thro to the DB which is expecting 'XXX' for strings.
Ed
Re: Why does the default value for a property not appear in when inserting via ED Grid?
Posted: Thu 25 Apr 2013 16:58
by Shalex
This is correct. We are investigating the way to provide the possibility of setting string default value without quotes.
Re: Why does the default value for a property not appear in when inserting via ED Grid?
Posted: Thu 25 Apr 2013 17:10
by EdB
Not really a problem. Just needs highlighting. A short term fix would be to add this info to the help at the bottom so
>The default value for the property
could become
>The default value for the property. Remember strings should use single quotes ie 'test'.
That addition would have saved me half a day .
Re: Why does the default value for a property not appear in when inserting via ED Grid?
Posted: Tue 30 Apr 2013 15:53
by Shalex
EdB wrote:Just needs highlighting.
Thank you for the suggestion.
There will be a possibility of setting a string default value without quotes starting from the next build of Entity Developer. We will post here when it is available for download.