UniqueColumnPolicy - not working with Lookup fields (including users)


The UniqueColumnPolicy doesn't work with looup fields (including users) although these fields are listed in UniqueColumnSettings.ascx.
THis is because the CAML query created in Validation.cs only returns the ID as the value.
There is a simple way to avoid this: detecting if the field type is "User" or "Lookup" and if so, add the following attribute to the FieldRef node LookupId="TRUE".
You will find attachedd the updated Validation.cs (modifications are from line 101 to line 116)

file attachments


sfurbacher wrote Oct 8, 2010 at 2:44 PM

Impact should be raised.

mcalicea wrote Nov 18, 2010 at 12:45 PM

How can I add this Validation.cs file to solution? I am new to features and was wondering if I have to replace the file and then load it to my Sharepoint collection or can I do it after its already deployed?

wrote Feb 14, 2013 at 7:55 PM