ow do you prohibit SharePoint users from adding an item to a list that has the same Title (or some other column) value as an item already in the list? If you are working with SharePoint 2010, and your users are not using the Datasheet View to add items, then there is a four-step (no code) process for preventing duplicate list items:
- Customize the List Form – You can use Microsoft InfoPath to customize the forms that are associated with lists. If you have the right permission level, click the List tab in the ribbon and then, in the Customize List group, clickCustomize Form to start InfoPath Designer 2010.
- Add a Data Connection – In the InfoPath Designer, click the Data tab and add a data connection that retrieves items from your list. In the Data Connection Wizard, make sure you select the Title column (or whichever column for which you want to prevent duplicate entries). The ID column will already be selected.
- Add a Data Validation Rule – In the InfoPath Designer, add a data validation rule for the text box that is bound to theTitle column. The rule should contain an expression that checks the current Title value against values received from the data connection created in the previous step. In the expression, you should also confirm that the currentID is not already in the list, which will happen after the list item is saved.
- Publish the Form – After you have added the rule, use the Quick Publish icon at the top of the InfoPath Designer to publish the form back to the list.
No comments:
Post a Comment