6

I am creating subsites for individual clients. In the subsites I have different lists that capture information for the client. Some of those lists would be repeating (a client might have three properties, for example), meaning that they can add items ("rows"). But other lists really only need to capture one set of information. Now, I guess I could edit the view to disable the "Add item" button, but is there a cleaner way to prevent a user from entering more than one "row" of information into a list?

6 Answers 6

4

As Dan suggested, it's better to use Calculated value as default:

enter image description here

Also, you can add this script to the NewForm.aspx:

$("[id^='Title_']").disabled = true

It will make sure the users cannot change the Title field:

enter image description here

Also, you can disable Quick Edit mode for the list to insure there is no easy workaround

I don't think using Workflows is an elegant solution

6

There are several way that you could do this. You could use an event receiver to enforce the constraint or you could use a field set to the value of the individual's user name and set it to be unique. You could do this with a workflow if you wanted a "code free" way of doing it. However, they could go back and change the value of this field.

In this case, I would likely use an event receiver as it would have fewer moving parts and could not be easily subverted but could still be disabled by an admin if required at some point.

2

You could add a person/group column called 'AlreadyCreatedBy'. You could set that column to require unique values. Then, enable content approval on the list. Set up a workflow that copies 'Created By' to 'AlreadyCreatedBy' and if it succeeds then set the approval status of the item to approved.

2
  • So if a list is "approved" then it prevents further entry? Seems like overkill. Is there no other way?
    – REMESQ
    Jun 26, 2012 at 16:42
  • The approval process would prevent further items from showing up in the list. The Workflow itself would handle approval. Jun 26, 2012 at 18:46
2

If the client, in your case, is entering in a single-row set of data, it sounds like an opportunity to make use of surveys. Surveys can be configured to allow only one submission and that can further be configured to allow edits in the future, or it can be locked down (if I recall correctly)

2

Have used this with SharePoint 2010:

  1. Column "Title" changed to calculated value "=Me"
  2. Created next workflow in SharePoint Designer:
    • If Current Item:Title equals Current List:Title
    • Delete item Current Item

Result: New entry will be created and in some seconds removed.

0

something easy to do is to declare a column unique, then set default value to anything and hide the column so it cant be modified by the user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.