This project has moved. For the latest updates, please go here.

Check for 2 values to be unique on one list item

Sep 5, 2014 at 9:32 PM
Edited Sep 5, 2014 at 9:35 PM
Is there a way to check a sharepoint list to see if any of the items contain 2 specific values on my current form? Is a CAML query the only option for doing this?

IE: Current form has Employee number and Year, query list to see if any item contains both those same values, if they do then...

Efficiency is important as this is performed when the form is loaded, and could be potentially hundreds or close to a thousand (small) forms to sort through. Would it be faster to query the list based on something like the employee ID first, and then check against the smaller list to see if the secondary value exists?
Sep 5, 2014 at 9:40 PM
There aren't hundreds of "forms", but hundreds of items in the list.

Probably the best route based on how you've explained it is to do a GetListItems with both values in the CAMLQuery.

Sep 5, 2014 at 10:52 PM
I was probably overthinking it a bit, thanks for the confirmation.