Jump to content

Validating a field using SQL custom function


This topic is 1844 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a uniqueness criteria for a particular number field, but the uniqueness is based on a combination of the number field with a state field (e.g. the number must be unique within all records for that state). I built a custom function to return a boolean if the number+state combination already exists in the database, and that CF uses a simple SQL query,

Issue is that the CF seems to work flawlessly when tested via Data Viewer, but when inserted as the field validation calculation, returns a validation failure for any value entered.  

Can anyone enlighten me as a to a limitation here I may not be aware of? My work around path is a field level trigger to a validation script, but do feel like I am missing something. 

Cheers,
Juz. 

Link to comment
Share on other sites

This topic is 1844 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Similar Content

    • By bgscott
      I have a field, item ID, set to auto enter a serial number and validation set to not empty and unique.  If the serial number entered is not unique I do not get an error message when exiting the item ID field.  If I turn off auto enter serial number and manually enter a non unique item ID, I do get an error message when I exit the field.
      With auto enter a serial number turned on I only get the non unique error message when I commit the record.  I would like to get the error message when exiting the field when auto enter a serial number is turned on
      Any suggestions?
    • By Sinky
      Hi people!
      I have a field which validation is set to Always, Allow user to override during data entry unchecked, unique value, custom message checked.
      When validation fails the message box offers two options: revert record and OK.
      Is there a way to trigger particular script if I choose OK?
      or is there a way to get the message with only one option (revert record) to choose?
      Much obliged!
       
    • By J_rge
      I can see the process appear in the Task Manager and then disappear immediately. And there are no events or messages on FM Server Console that show failed authentication.
      I'm running Windows 10 2004. And the client version is 14.0.4.406_x64.
      Update: Under Event Viewer I can see LIBEAY32.dll is the faulting process.
      Update 2: I have updated the client to 14.0.6.602 and had the same results.
    • By lutfishah
      Dear All,
      I am trying to put a conditional formatting validation which turns Red when the value is entered wrong. Basically all my tries have failed so I would like your help here.
      The criteria of entering a value is 
      xxxx-xxxx-xxxx-xxxx
      1111-2222-3333-4444
      1. Length of value is  = 19     OR      this should be a 16 digit number, in groups of 4 separated with dashes
      2. Non-Digits characters are not valid.
      Please could you help me with this and I will really appreciate. 
      Many thanks
      Regards
      Lutfi
       
    • By Tom R.
      Having trouble with an ExecuteSQL calculation. I used SeedCode's SQL Explorer to build the calculation. It works fine if I use literal values from a specific record; but if I instead change it to a field reference, the calculation fails. I get the message <unrelated table> in the Data Viewer. The code is below. Am I misusing the field names somehow?   // Build SQL Query q = "SELECT SUM ( " & ainterestMineralDecimal & " ) FROM " & [email protected] & " WHERE " & a_id_lease & " = ? AND " & a_id_tract & " = ? AND " & a_id_unit & " = ? " ;   // Run SQL Query result = ExecuteSQL ( q ; Char ( 9 ) ; "|*|" ; @LineItems::_id_lease ; @LineItems::_id_tract ; @LineItems::_id_unit ) ] ;   Thanks,   Tom RuBane
  • Who Viewed the Topic

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.