Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
16 replies
Subscribers
8 subscribers
Views
7908 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Uniqueness of a field
sergeiz1
over 7 years ago
Hello!
What is the best way to keep some CDT field unique? It will be a constraint in the database, but the database error message is not user friendly.
I can set it up as a query rule or expression and validate manually in the interface. In this case the designer should remember what fields have to be validated.
May be there is an easier and straightforward way to achieve it?
OriginalPostID-273384
Discussion posts and replies are publicly visible
Parents
0
Stefan Helzle
A Score Level 3
over 7 years ago
Two possible ways:
1) Add a validation which checks by querying database if the entered value already exists in DB. Problem is that another user could enter the same value at this time and the check would be OK for both.
2) Directly write the data to DB in the saveInto (a!writeToDatastoreEntity()) and react on failure/success of the operation. This way two users cannot enter the same value at the same time.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Stefan Helzle
A Score Level 3
over 7 years ago
Two possible ways:
1) Add a validation which checks by querying database if the entered value already exists in DB. Problem is that another user could enter the same value at this time and the check would be OK for both.
2) Directly write the data to DB in the saveInto (a!writeToDatastoreEntity()) and react on failure/success of the operation. This way two users cannot enter the same value at the same time.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data