Developer forum

Forum » Development » Ensure unique values in a field on code-first ItemTypes

Ensure unique values in a field on code-first ItemTypes

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I was wondering if there is any way of making sure a field of the item type will have unique values when submitted.

I have a field that I am using for uniquely identifying a page and it would be very useful to make sure the user cannot fill a duplicated value in that field.

Thank you,

Adrian


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Adrian

There is no such feature, so adding a notification subscriber somewhere to check or adding a javascript call in the frontend before submitting checking the unique value is my best bet.

BR Nicolai

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for the answer. I did not had high hopes on this, as it does not make a lot of sense since you would have to always make sure the values are unique per Area they are created in which makes the logic very complicated.

I just wanted to check just to be sure.

Thank you,

Adrian

 

You must be logged in to post in the forum