How to Show or Hide Different Fields on the New, Display and Edit forms Without any Code


By:   |   Updated: 2011-07-14   |   Comments   |   Related: > SharePoint


Problem

I want to show or hide different list fields in each of the New, Display and Edit forms, based on a user's group membership. I need a "No-Code" solution for this.

Solution

SPListDisplaySettings comes to the rescue.

This is a SharePoint feature (for WSS 3.0 and MOSS) that provides advanced settings to customize list form rendering for the New, Display and Edit modes.

I would like to put an emphasis here that the software listed on Codeplex is a community supported code base which is not connected to Microsoft and is provided "AS IS", without warranty of any kind. You are responsible on your own and I strongly recommend to make a thorough testing in a lab or test environment, and always make a backup of your current environment state before implementing the solution. You may also find useful information on the solution webpage, under the discussions board and find helpful information provided from other people that are using or have tried to solution.

Assumptions:

To do this task you should have a basic understanding about the following:

  • Creating SharePoint Lists, able to add and remove fields as well as create SharePoint groups.
  • Have permission on your front-end servers to install the feature, deploy and activate it.

Download the installable package from codeplex (http://splistdisplaysetting.codeplex.com/ )and run it in on your environment.

select installation folder
check system
installation complete

Next, go to Central Administration --> Operations --> Solution Management to check if your solution has been deployed. If not, hit the "Deploy Solution" button.

 
deploy solution
deploy solution

You can define when to be deployed, or just hit the "OK" button to deploy it immediately. Do not forget to choose which web application you would like the solution to be deployed.

solution management

The next step is to activate the solution on a site collection level. Open the web application that you chose and go to "Site Actions", then "Site Settings", then under Site Collection Administration click "Site collection features"

site collection features

You can see that the solution is there but not Activated. Hit the "Activate" button to start using the capabilities of this solution.

activate
display settings

Once it is activated, the solution is available to every list in the web application you have deployed it to. So, let's see how it works.

We create a custom list for a project that we might have some approval process and we add a few fields to it from Settings --> List Settings and then click the "create column" button.

bewise
general settings

We want the user to fill in only particular fields, in our case it is the Title, Product, Amount and Due Date fields.

We want another employee/manager to be able to see these fields when he/she opens the request, and either approve or reject it from the "Approval" field.

And once it is approved from a manager,  we need to have another employee who is responsible for the request and delivery of the requested products/goods to mark the "Delivery Date" field.

This is how a normal form looks like after we create our fields:

new item

We go once again in List Settings, and under General Settings we click on "Display settings (powered by Bewise)

general settings

We can see all our fields and the mode we want to set them to appear or not depending if the Current User is in a specific group or not.

display settings

Pay attention here, you must grant permissions to the list with your required SharePoint groups, otherwise you will not see them in the drop-down menu as a choice to select it.

permissions

We fill in a request and we can see that only the desired fields are shown to our user.

test

If we log on with the account/username who is a member of the SharePoint "Managers Group" we can see the "Approver" field on Edit mode.

approval

And if we log on with the account/username who is a member of the SharePoint "Delivery People" group, we will see the "Delivery Field" available in Edit mode.

delivery date

And finally, the Display form presents all the fields to everybody, as we have set it up, but you can customize it on the display form as well.

test

Conclusion

Re-using this possibility to show/hide test any field to users in a group to any other list is a fast setup and doesn't require much SharePoint knowledge, and if you have a custom workflow process tied together, it can give you a powerful process which is easy to setup and maintain.

Next Steps


Last Updated: 2011-07-14


get scripts

next tip button



About the author





Comments For This Article





download





Recommended Reading

Reading SharePoint Lists with Integration Services 2017

Using a SharePoint List as a Data Source in SQL Server Reporting Services 2008 R2

Using SSIS to Automatically Populate a SharePoint List

Understanding SharePoint Exports to Excel

PerformancePoint Dashboard - a Primer








get free sql tips
agree to terms