Question

I have created a Tasks List in SharePoint. When I try to add a new Task, it opens a form with few visible fields like TaskName, StartDate, DueDate, Description, AssignedTo. When I click on 'ShowMore', then it is showing all the remaining fields like %complete, TaskStatus, Priority, Comments, ExpectedDueDate.

Issue: I want all the fields to be visible from the start without clicking on 'ShowMore', because some people might get confused with this option and may skip filling these fields. Can someone please kindly suggest how to achieve this. Any help is greatly appreciated. Thank you!

Was it helpful?

Solution

Unfortunately there is no such setting that allows to configure fields visibility in tasks form AFIK.
But task form could be customized in order to display all the fields as demonstrated below.

Since it is a SharePoint 2013 environment, the following approach is suggested:

  • Create rendering template to display all the fields in New & Edit forms
  • Update Task web part in New & Edit forms pages

Template file

The following example demonstrates how to display all the fields of Task form:

(function () {


    function preTaskFormRenderer(renderCtx) {
       rlfiShowMore();
    }


    function registerRenderer()
    {
      var ctxForm = {};
      ctxForm.Templates = {};
      ctxForm.OnPreRender = preTaskFormRenderer;

      SPClientTemplates.TemplateManager.RegisterTemplateOverrides(ctxForm);
    } 
    ExecuteOrDelayUntilScriptLoaded(registerRenderer, 'clienttemplates.js');

})();

How to apply changes

  1. Upload the specified script (lets name it TaskForm.js) into SharePoint Site Assets library
  2. Open New Form page in edit mode and go to Tasks web part properties
  3. Specify JS Link property located under Miscellaneous group: ~sitecollection/SiteAssets/TaskForm.js (see pic. 1)
  4. Save changes and repeat steps 2-4 for Edit form

enter image description here

OTHER TIPS

I prefer other methods to the JavaScript workaround to really solve the problem: 1. You can change the list form assigned to the local Task content type, for example via PowerShell:

$web = Get-SPWeb http://YourSharePointSite 
$list = $web.Lists["Tasks"] 
$ct = $list.ContentTypes[0] 
$ct.DisplayFormTemplateName = "ListForm" 
$ct.NewFormTemplateName = "ListForm" 
$ct.EditFormTemplateName = "ListForm" 
$ct.Update()
  1. You can set the list form assigned to the ListFormWebPart via SharePoint Designer
  2. Create your own control template and add the ShowExpanded="true" attribute to the TaskListFieldIterator control
  3. Pass the Expanded=1 in the request query string like NewForm.aspx?Expanded=1
  4. Change the default column order of the local Task content type

All of these have the effect of displaying all the fields without the "Show More" button. You can read more about these methods here: http://pholpar.wordpress.com/2014/11/01/no-more-show-more-in-tasks-lists/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top