0
votes

We have created a custom list form with SharePoint designer and now the requirement is like below:

User will request server creation using this form and now server can be of any type which user can choose from a drop-down such as Production,stage,Test or multiple production servers are required. And for each server type, there will be corresponding 20-25 fields which user need to fill for that server details. so i want to know the best way to achieve this as we cant create 200-250 list columns in this list and scrolling also will be a difficult task while user will submit the request. So what is the best way to achieve this requirement?

enter image description here

2

2 Answers

1
votes

You can create a list containing all server types that will be used to create a server type lookup. Then you can create a list with a 'Server Type' column and 'Server Requirements' (multiple lines of text) column. You can store all requirements for a particular server as a JSON object e.g.:

{"RAM":"8GB", "CPU":"4"}

OR you can create a nested JSON object for each server type e.g.

{"ServerType": "Staging", "Requirements": {"RAM":"8GB", "CPU":"4"}}

wherever you want to show/send/populate data, you just need to retrieve this json and parse. Hope this helps.

0
votes

first I think the recommended way would be to try OOTB SharePoint solutions and in Your case I think You could try to use ContentTypes and OOTB list forms.

Lets say You create a content type per server type. To each type You add only the 20-25 fields that are corresponding to this server type. Then in list settings in advanced settings You turn on content type management and You add does content types to the list (also hide the default Element content type). After that when the user will want to add a new item to the list he will be albo to chose between the content types (server types in Your case), and after that the form will have only the fields that are added to this content type. Also in edit form the user will be able to pick between content types and will see only the corresponding fields. Please see the attached screens to also understand what I mean on a very simple case:

list

  • ContentType1 (ColumnA)
  • ContentType2 (ColumnB, ColumnC)

enter image description here


enter image description here


enter image description here


if this OOTB features are not enough and You already created a custom form using SharePoint Designer enter image description here Then You should be able to attach custom javascript file to it and jQuery library. The javascript You may store under _layouts path on server. Every field in the form has its own tr (row) You could to each row attach some custom css class like-

class="forServerProd allFields"
$(".allFields").css('dispaly','none'); // first hide all
$(".forServerProd ").css('dispaly','table-row'); // then show only relevant