2

I have a list with 30 unique views. Each view has one or two columns hidden from the overall columns.

However, When I select a particular view and then click on add new item, it opens up the form which shows all the fields to be filled in the form.

Is there something I could do which would show only those fields in the forms which exist in that particular view of the list ?

Thank you

1 Answer 1

2

One option would be to create a Content Type for each different version of the form that you want. Then you could go in and individually include or exclude columns, make them required or not required (depending on the content type), or include but hide them.

Here's a good introduction to Content Types:

https://msdn.microsoft.com/en-us/library/office/ms472236(v=office.14).aspx

I anticipate there would also be ways of doing it via JavaScript, JQuery, or InfoPath, but we would need more information about when different fields should show up.

4
  • 1
    There are 30 different contracts. So I created a view for each of the contracts which reflects the columns they want to see. Now, when someone belonging to Contract A selects the corresponding view contract A, and when he adds a new item, he should be seeing only those fields in the new/edit/display form based on the contract view. If contract = A the new form should display some elements If contract = B the new form should display some other elements I could have done 30 separate lists but managing them would be a pain and lists will grow to 50 and may be 100 in due course. Sep 7, 2016 at 12:23
  • 1
    Thank you @rolemartyr-x Actually, out of those 30 views/contracts, majority of them are going to use the same form elements and structure. However, there are 3-4 contracts who would want to have extra fields or may want to remove certain field from the default view and hence should have separate form view that matches their list view too. Sep 7, 2016 at 12:27
  • In that case, I think the Content Types will be a good choice for this situation. They may take a bit of time to set up at first, but they will be easy to maintain and change over time, as needed. I know you could also use some code to conditionally show/hide fields based on a selection (e.g. selecting Contract A from a drop down causes code to show Contract A-related fields), but I unfortunately don't have enough experience to delve into that option. Based soley on an instance of that solution in my company's environment, I fear it may not be easy to maintain over time. Sep 7, 2016 at 12:33
  • I implemented this solution using InfoPath to conditionally load the new form. It works like a charm and pretty easy to implement as well. Sep 15, 2016 at 11:28

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.