I have a SharePoint list with these fields:
- Destination - User picks a person
- Created by - User who created the item
Is there a way to prevent users from creating item for themselves using validation settings?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.Sign up to join this community
By using list validation not column validation. I would need to know more about Destination though. If Destination matches Created by then you can fail and show a message to the user.
Destination: Smith, John Created by: Smith, John
If(NOT([Destination]=[Created by]), TRUE, FALSE)
If the condition valuates to true, the new item will be saved. If not it will display the error message.
Unfortunately there is no way to use either column or list validation to prevent users from creating an item in this way.
This is because the Created By column is not populated until the item is created, and validation occurs before the item is saved. Thus there is nothing to compare the Destination field value against during validation.
In order to prevent users from entering their own name here, you would have to implement some code on the NewForm.aspx page of this list.
Hope this helps!