Business requirement: Hide list fields upon creation / modification of a SharePoint list item with the SharePoint GUI
In a previous blogpost Hide list fields upon creation of a SharePoint list item, I talked about how to hide a SharePoint list field upon creation of a list item and to show it upon modification of that same list item.
Unfortunately, this is something which cannot be achieved by using merely the out-of-the-box administration tools of SharePoint, but the SharePoint Tips Utility Pack could help you out. This great tool has some disadvantages:
- You can only run it on the SharePoint server itself.
- If you are a SharePoint implementator, you can set the properties of each field with this tool. Unfortunately, if power users of the SharePoint environment afterwards want to change anything to a field, they are not able to do this anymore (whereas they are able to change views,add content types or add columns on a SharePoint list you have set up for them by going to the appropriate settings forms).
Solution: use the SPListDisplaySetting feature
Laurent Cotton created a SharePoint feature: SPListDisplaySetting, also available on CodePlex. After installing this SharePoint feature (it comes with a nice install wizard), activate the feature on your site collection.
After activation of the SPListDisplaySetting feature for the site collection, each SharePoint list will have automatically an extra topic when you go to the List Settings: Display settings (powered by Bewise) (in the General Settings section).
Clicking the Display settings will give you a form on which you can set the display properties for each field on the new item form (NewForm.aspx), the edit item form (EditForm.aspx) and the display item form (DispForm.aspx).
Following options are available for the display property on each form:
- Always: the field or column will always be visible on that particular form.
- Never: the field or column won't be visible on that particular form: you can use this to hide list fields upon creation of a new SharePoint list item as alternative solution to the one described in my blogpost Hide list fields upon creation of a SharePoint list item.
- Where: with this option you can make the visibility of the field or column depending on a condition. This adds even more functionality than what can be achieved with the SharePoint Tips Utility Pack. The conditions available are currently limited to verifying if the currently logged in user is belonging or not to a certain SharePoint group.
After setting the display properties for each SharePoint field of your list, execute an iisreset: you 'll notice right away the changes in your NewForm.aspx, EditForm.aspx or DispForm.aspx.