Jump to content
  • 0

Unique Records Check


ChrisCarlson

Question

I would like to add the following functionality to a datapage text field. When the user types in a value, I would like to check the database to make sure the value does not previously exist in any records. If the value exists I would like it to cause an error message and not allow the user to submit the record. Any recommendations on how I could achieve this?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi, just to add to the previous comments above, you may use a calculated field/calculated value to check if the value/record is already existed in the table using this formula:

CASE WHEN (SELECT COUNT(FIELDNAME) FROM TABLE WHERE CODE=target.[@field:CODE) > 1 THEN 'EXISTING' ELSE 'NOT EXISTING' END
 

And, you may create now a JavaScript code that will display an error based on the result of the calculation.  I hope this helps.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...