KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to detect "Reject Null value inputs"
PRODUCT: 4D | VERSION: 15.2 | PLATFORM: Mac & Win
Published On: June 14, 2016

It is possible to Reject Null value inputs. In some cases it may be useful to get this information while the application is running. This can be done with SQL by querying the _USER_COLUMNS table and checking the NULLABLE field.

Field ConfigurationSQL
"Reject Null value inputs" unchecked NULLABLE="TRUE"
"Reject Null value inputs" checkedNULLABLE="FALSE"


The following method could be used to obtain this information:
C_POINTER($1)
C_BOOLEAN($0;$out)
C_TEXT($varName)
C_LONGINT($tNum;$fNum)
If (Count parameters=1)
   RESOLVE POINTER($1;$varName;$tNum;$fNum)
   Begin SQL
      select NULLABLE
      from _USER_COLUMNS
      where TABLE_ID = :$tNum
      AND COLUMN_ID = :$fNum
      into :$out;
   End SQL
   $0:=Not($out)
End if


If the method above is saved as "UTIL_DoesFieldRejectNull" then it could be used like this:

C_BOOLEAN($f)
$f:=UTIL_DoesFieldRejectNull (->[Table_1]Field_2)