Wednesday, June 8, 2016

Unique Constraints Programmatically SharePoint

SPSite site = new SPSite("http://peakfinders");
SPWeb web = site.OpenWeb();

SPList custList = web.Lists["Employee"];
SPField vtid = custList.Fields["VoterID"];

vtid.Indexed = true;
vtid.EnforceUniqueValues = true;
custPhone.Update();

No comments:

Post a Comment