# Database Defaults

**URL:** <https://forum.radzen.com/t/database-defaults/261>\
**Category:** Angular\
**Created:** [March 22, 2018, 6:16pm UTC](https://forum.radzen.com/t/database-defaults/261 "2018-03-22T18:16:15Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [March 22, 2018, 6:16pm UTC](https://forum.radzen.com/t/database-defaults/261/1 "2018-03-22T18:16:16Z")

</div>

Hello RadZen Team,  
i have many database defaults especially for bit (checkboxes) columns with NOT NULL constraints. i see that RadZen didnt remember these defaults while creating pages. so im forced to add a default values manually to every page. this is very time consuming. Is there an easier way to solve this?

Regards  
Thomas

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [March 23, 2018, 8:03am UTC](https://forum.radzen.com/t/database-defaults/261/2 "2018-03-23T08:03:43Z")

</div>

Hi Thomas,

Indeed at the moment Radzen will check only NOT NULL constraints and not default values from SQL. There is a way however to describe default values with EF Core and we will include fix for this in our next release (next week).

Best Regards,  
Vladimir

---

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [March 23, 2018, 8:05am UTC](https://forum.radzen.com/t/database-defaults/261/3 "2018-03-23T08:05:37Z")

</div>

HI Vladimir,  
that sounds great! Thank you!

Regards  
Thomas

---

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [March 23, 2018, 8:07am UTC](https://forum.radzen.com/t/database-defaults/261/4 "2018-03-23T08:07:40Z")

</div>

will the new funcionality available in both core 1.0 and 2.0?  
im using 1.0 for now.

Regards  
Thomas

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [March 23, 2018, 8:37am UTC](https://forum.radzen.com/t/database-defaults/261/5 "2018-03-23T08:37:10Z")

</div>

Hi Thomas,

It will be available for both .NET Core 1.x and 2.x!

Best Regards,  
Vladimir

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [March 24, 2018, 6:37am UTC](https://forum.radzen.com/t/database-defaults/261/6 "2018-03-24T06:37:51Z")

</div>

Hi Thomas,

Just to let you know that Radzen 1.32.3 is already released with default values support included (properties with default values will not be required anymore when trying to add new records). For .NET Core 2.x projects also Radzen will use Fluent API to describe relations in order to avoid Data Annotations regressions in EF Core 2.0.

Please regenerate your app if you want to use default values or .NET Core 2.x.

Best Regards,  
Vladimir

---

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [March 24, 2018, 11:23am UTC](https://forum.radzen.com/t/database-defaults/261/7 "2018-03-24T11:23:56Z")

</div>

Hi Vladimir,  
checking for Updates didnt work. Firewall and Kaspersky are off. Is it a problem on my side?

 ![image](https://forum.radzen.com/uploads/default/original/1X/9f4198b50b7f2c24b9aa42eb36f30c7753b100c8.png)

Checking for update message comes up and nothing happens until i close it.

I deinstalled radzen, download 1.32.3 and installed from your website. Same Problem.

Regards  
Thomas

---

<div class="post-metadata">

**Author:** ![korchev](https://forum.radzen.com/user_avatar/forum.radzen.com/korchev/32/4_2.png) [@korchev](https://forum.radzen.com/u/korchev)\
**Post date:** [March 24, 2018, 12:34pm UTC](https://forum.radzen.com/t/database-defaults/261/8 "2018-03-24T12:34:19Z")

</div>

1.32.3 is the latest version. Just close the update message and Radzen will work as expected. We will investigate for any issues with the update server.

---

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [March 26, 2018, 7:13am UTC](https://forum.radzen.com/t/database-defaults/261/9 "2018-03-26T07:13:46Z")

</div>

Hi Artanas,  
i freshly generated a new app with Radzen 1.32.3 from scratch. The Database Defaults didnt work. the required messages came up as before. although i see that the defaults are generated

 ![image](https://forum.radzen.com/uploads/default/original/1X/3dea93efc36146906fae2020a8458af2ce2c99ee.png)

adding a record:  
[video](https://www.screencast.com/t/sC5xYYm9dKd)

"aktiv" and "ueberwachungsbeduerftig" has defaults in the database.

Regards  
Thomas

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [March 26, 2018, 7:26am UTC](https://forum.radzen.com/t/database-defaults/261/10 "2018-03-26T07:26:36Z")

</div>

Hi Thomas,

You are right! Properties with default values are not properly excluded from required fields, we will fix this immediately!

Best Regards,  
Vladimir

---

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [May 9, 2018, 11:33pm UTC](https://forum.radzen.com/t/database-defaults/261/11 "2018-05-09T23:33:03Z")

</div>

Hi Vladimir,  
is it possible to set the Default Properties from the Database in the form fields on the Add page?

 ![image](https://forum.radzen.com/uploads/default/original/1X/bc6bd1284fadeee606950cc72481978dff764a86.png)  
Its clear that i can do that with the DeafultValue property in Radzen... but what an effort ☹  
I have around 100 defaults in my database... and there are many of them which are only with default as an easement for users.  
E.g. the Leihfahrzeug is in 80% of adding a new Fahrzeug false. When i do not set the DefaultValue in Radzen users must set Leihfahrzeug manually to false.

Kind Regards  
Thomas

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [May 10, 2018, 6:12am UTC](https://forum.radzen.com/t/database-defaults/261/12 "2018-05-10T06:12:49Z")

</div>

Hi Thomas,

When you have default value from database for a property you can submit the form (add new record) without specifying value for this property.

Best Regards,  
Vladimir

---

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [May 10, 2018, 6:23am UTC](https://forum.radzen.com/t/database-defaults/261/13 "2018-05-10T06:23:29Z")

</div>

Hi Vladimir,  
yes. i know. i have several defaults that works like this and i make them invisible on the add page. But there are much more default values in the database that must be shown to the user while adding a record. It is because the user must have the choice to change them before submitting.  
E.g. the “Leihfahrzeug” field is in 80% of adding a new Fahrzeug “false”. But in around 20% true. So i wish to show the user the most propably value. I cant submit the default value as it is… the user must decide.

You know what a mean?

Kind Regards  
Thomas

---

<div class="post-metadata">

**Author:** ![enchev](https://forum.radzen.com/user_avatar/forum.radzen.com/enchev/32/16_2.png) [@enchev](https://forum.radzen.com/u/enchev)\
**Post date:** [May 10, 2018, 6:38am UTC](https://forum.radzen.com/t/database-defaults/261/14 "2018-05-10T06:38:33Z")

</div>

Hi Thomas,

Database defaults are in SQL format, often SQL functions. They cannot appear as values in the Angular app.

Best Regards,  
Vladimir

---

<div class="post-metadata">

**Author:** ![ThomasS](https://forum.radzen.com/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@ThomasS](https://forum.radzen.com/u/ThomasS)\
**Post date:** [May 10, 2018, 6:46am UTC](https://forum.radzen.com/t/database-defaults/261/15 "2018-05-10T06:46:13Z")

</div>

Hi Vladimir,  
Ok. I see the problem. The values must be converted for each database system.  
Other way… can i set the default value programmatically before the add page is shown? Perhaps on the server side in the Controller? With a partial class? I see the “partial void OnFahrzeugCreated(Models.Eschadendb.Fahrzeug item);”  
Something like this?

Regards  
Thomas
