﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Form not allow user to leave blank on foreign key even the “ALLOW NULL” is granted</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Thu, 10 Sep 2026 00:47:48 GMT</lastBuildDate><ttl>20</ttl><item><title>Form not allow user to leave blank on foreign key even the “ALLOW NULL” is granted</title><link>http://forum.strataframe.net/FindPost28265.aspx</link><description>Dear Sir&lt;br/&gt;&lt;br/&gt;&lt;font color=#000000 size=3 face=Calibri&gt;If a form, which has a foreign key to another parent table, the form is save with leaving this foreign key blank. It encounter error when the form recall this record with error message. I have set this foreign key to accept NULL values. The problem not occurs when I cancel the relationship between the 2 tables. But delete the relationship will have no reference integrity checking with this foreign key fields.&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font color=#000000 size=3 face=Calibri&gt;Example:&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font color=#000000 size=3 face=Calibri&gt;Said the Employee table has a foreign key to Tax table. So, there is a need to have a relationship between “Employee” vs “Tax”. So that the reference integrity can be checking. But not all the employee entitled Tax. In this case, when my Employee form is saved with Tax field is NULL, next time reopen the employee form will prompt error message.&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;Andrew</description><pubDate>Sat, 11 Sep 2010 07:20:23 GMT</pubDate><dc:creator>rsb1</dc:creator></item><item><title>RE: Form not allow user to leave blank on foreign key even the “ALLOW NULL” is granted</title><link>http://forum.strataframe.net/FindPost28333.aspx</link><description>I am glad to hear that, Tiong.&lt;br/&gt;&lt;br/&gt;You are most welcome. :cool:</description><pubDate>Sat, 11 Sep 2010 07:20:23 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Form not allow user to leave blank on foreign key even the “ALLOW NULL” is granted</title><link>http://forum.strataframe.net/FindPost28327.aspx</link><description>Hi Ivan,&lt;br/&gt;&lt;br/&gt;I want to thanks to you again and again for solving my question. It's work great...</description><pubDate>Sat, 11 Sep 2010 07:03:46 GMT</pubDate><dc:creator>Tiong Diu King</dc:creator></item><item><title>RE: Form not allow user to leave blank on foreign key even the “ALLOW NULL” is granted</title><link>http://forum.strataframe.net/FindPost28326.aspx</link><description>Hi Tiong.&lt;br/&gt;&lt;br/&gt;Guess I got it wrong when I read your first post. Maybe you should leave your foreignkey NULL and deal with the NULL value. Have a look at the BO Mapper and the properties' Custom Field Properties. There you can deal with the NULL Value Option. To get you started, go to the help file under "Application Framework" / "Business Layer" / "Business Object Mapper" / "Customizing a Field".</description><pubDate>Sat, 11 Sep 2010 06:51:56 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Form not allow user to leave blank on foreign key even the “ALLOW NULL” is granted</title><link>http://forum.strataframe.net/FindPost28309.aspx</link><description>Hi ivan,&lt;br/&gt;&lt;br/&gt;extend to my previous reply, i know the problem occur at where and need you advice. If my foreign key "state" (data type is integer) inside my employee table allow null. Then if state no selected and is null value saved for state into employee table. when BO try to retrieve data from employee table and it hit error due to cannot convert null value to integer for state in employee table. In BO scheme, state's data type is integer.&lt;br/&gt;&lt;br/&gt;Please advice</description><pubDate>Fri, 10 Sep 2010 07:57:19 GMT</pubDate><dc:creator>Tiong Diu King</dc:creator></item><item><title>RE: Form not allow user to leave blank on foreign key even the “ALLOW NULL” is granted</title><link>http://forum.strataframe.net/FindPost28302.aspx</link><description>Hi Ivan,&lt;br/&gt;&lt;br/&gt;I did tried it to set default to 0 but sql server 2008 do check the reference integrity to that table whether got the primary = 0 before save.&lt;br/&gt;If we let the integer field to NULL and strataframe prompt the message cannot convert NULL value to integer when we open the form.&lt;br/&gt;Maybe you got the idea how to make changes in the strataframe framework to covert NULL value to integer to prevent this error.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Please advice</description><pubDate>Thu, 09 Sep 2010 21:58:44 GMT</pubDate><dc:creator>Tiong Diu King</dc:creator></item><item><title>RE: Form not allow user to leave blank on foreign key even the “ALLOW NULL” is granted</title><link>http://forum.strataframe.net/FindPost28274.aspx</link><description>Not sure, but to avoid dealing with NULLs, you could set it to not accept NULLs and leave it with zero as a default value.</description><pubDate>Thu, 09 Sep 2010 09:33:52 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>