Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Validating two column combination to be unique

$
0
0

I have a List named "List 1" and it has two columns "Column 1" and "Column 2". I am aware that I can enforce unique values to both columns in separate. My requirement is a combination of both to be unique. Eg: Column 1 = ABC, Column 2 = PQR can happen only once in the list. (Same as multi column primary key constraint in a SQl DB)

One proposed way is having an event receiver to not to add that one but how can I display a message to the user back saying "Your record was not added since it is a duplicate?".


Viewing all articles
Browse latest Browse all 11571

Trending Articles