0)Use
Constraints[
^](PrimaryKey, Unique)
1)Before insert the record, check existence of the value in that table, sample query like below, if count is above 0 then value exists & you should notify the user about duplicate value(OR generate different ID....it's based on your requirement)
SELECT COUNT(*) FROM Table_Name WHERE Column_Name='SomeValue'