Page 1 of 1

Comparing Titles

Posted: Wed Jan 08, 2014 3:14 pm
by miplatt
Is it possible and/or worthwhile to have a field (entity/record name) in an HTML tab/interface do validation to make sure that when one enters a new entity/record name, he/she does not name an entity/record that already exists in the database? In other words, when one enters the name for a new entity, the system would recognize that such an entity/record already exists and pop up a message to the user saying so (therefore either that entity exists or the new entity needs a different name)?

With validation for an email address or website to make sure it is the correct form is quite simple and does not require many iterations (just a matter of making sure the input does not equal an accepted email or URL format). However, in the case of making sure that a particular name does not match any of the existing names in the database seems like it would take a long time and overload the system if I understand correctly (check each existing entity to make sure that the input does not equal it).

Is there a better way to accomplish this? Suggestions?

Certainly, all users are instructed to check first in the database to make sure that the desire record does not already exist. However, sometimes people do not do this and it would be nice to have a safeguard against double entries if possible.

Re: Comparing Titles

Posted: Wed Jan 08, 2014 5:12 pm
by ZevToledano
Just add a Unique Index to the field in question. In Custom Fields, open the field (first check 'built-in fields' if it's the Name field), and add an Index and make it unique.

Beware though, this will not allow blanks and also will not allow you to add the index if you already have duplicates in that field.

Re: Comparing Titles

Posted: Wed Jan 08, 2014 5:43 pm
by miplatt
Yes, the field is the built-in Name field. It already says "Yes" that it is currently indexed. Is that what you meant?

Re: Comparing Titles

Posted: Wed Jan 08, 2014 7:44 pm
by ZevToledano
'Unique' is a separate checkbox. That one needs to be checked too to make it unique.

Re: Comparing Titles

Posted: Thu Jan 09, 2014 10:11 am
by miplatt
Understood, found it. When I clicked on it, the system paused for a few seconds and then gave me a message that there are non-unique values in the field. (therefore as you said, it cannot be made unique).

Is there a way to detect all of the doubles? In saying "non-unique values" is the system referring to entities with the exact same name? Or even if it is mostly the same with even one letter or space difference?

By blanks you mean the name field left blank? or do you mean spaces between letters/words?

Re: Comparing Titles

Posted: Thu Jan 09, 2014 11:25 am
by ZevToledano
They must be exactly the same without any differences. Blank means the value is empty. Two blanks in two records make it non-unique.

To find duplicates, there is no built-in 'duplicate finder' tool yet, but you can go to the Browser and sort by that field to see what is going on easily.