Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Hide Default Task Columns

$
0
0

How do I hide the default Task columns like Priority and Status when displaying the task in the Display or Edit forms?

I have a custom workflow in SharePoint 2010, built using VS 2012. I use the CreateTaskWithContentType activity. My custom content type has it's own columns which I want to display when the user opens the task, but I don't need them to enter any values for the default columns, so I prefer to hide them. I've tried both the Hidden and ShowInDisplayForm attributes without any success. Any ideas?

 

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Task (0x0108) -->

<ContentType ID="0x010801003600255C4C644AEAAE4DBE72F5A84071" 
               Name="Salary New Hire Info" 
               Group="Custom Content Types" 
               Description="Salary Onboarding New Hire info Content Type" 
               Inherits="FALSE" 
               Version="0">
    <FieldRefs>

MY COLUMNS:

      <FieldRef ID="{7ea518d4-f0c8-45c2-b736-26db94f2b63c}" DisplayName="New Hire Name" Required="TRUE" Name="colNewHireName" />
      <FieldRef ID="{99a966fa-24f5-40e7-b775-13a7ee4ad74c}" DisplayName="Position" Required="FALSE" Name="colPosition" />
      <FieldRef ID="{b8508ae6-eed9-41c4-9b20-a741715e31b7}" DisplayName="Hire Date" Required="FALSE" Name="colHireDate" />
      <FieldRef ID="{bfac7766-6a4f-4c12-89d4-47fd8a4039c0}" DisplayName="Employee Number" Required="FALSE" Name="colEmployeeNumber" />
      <FieldRef ID="{aa973aa3-5e75-46fe-a002-39a3a4b290d9}" DisplayName="Home Email" Required="FALSE" Name="colHomeEmail" />
      <FieldRef ID="{dd32566e-be45-461a-9e14-17cd00e4ab6d}" DisplayName="Business Unit" Required="FALSE" Name="colBusinessUnit" />

DEFAULT COLUMNS:

      <FieldRef ID="{c042a256-787d-4a6f-8a8a-cf6ab767f12d}" Name="ContentType" />
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" Required="TRUE" ShowInNewForm="TRUE" ShowInEditForm="TRUE" />
      <FieldRef ID="{c3a92d97-2b77-4a25-9698-3ab54874bc6f}" Name="Predecessors" ShowInDisplayForm="FALSE" ShowInEditForm="FALSE" ShowInListSettings="FALSE" Hidden="true" />
      <FieldRef ID="{a8eb573e-9e11-481a-a8c9-1104a54b2fbd}" Name="Priority" Hidden="TRUE" />
      <FieldRef ID="{c15b34c3-ce7d-490a-b133-3f4de8801b76}" Name="Status" Hidden="TRUE" />
      <FieldRef ID="{d2311440-1ed6-46ea-b46d-daa643dc3886}" Name="PercentComplete" Hidden="TRUE" />
      <FieldRef ID="{53101f38-dd2e-458c-b245-0c236cc13d1a}" Name="AssignedTo" />
      <FieldRef ID="{7662cd2c-f069-4dba-9e35-082cf976e170}" Name="Body" />
      <FieldRef ID="{64cd368d-2f95-4bfc-a1f9-8d4324ecb007}" Name="StartDate" />
      <FieldRef ID="{cd21b4c2-6841-4f9e-a23a-738a65f99889}" Name="DueDate" />
      <FieldRef ID="{e506d6ca-c2da-4164-b858-306f1c41c9ec}" Name="WorkflowName" />
      <FieldRef ID="{17ca3a22-fdfe-46eb-99b5-9646baed3f16}" Name="FormURN" />
      <FieldRef ID="{78eae64a-f5f2-49af-b416-3247b76f46a1}" Name="FormData" />
      <FieldRef ID="{8cbb9252-1035-4156-9c35-f54e9056c65a}" Name="EmailBody" />
      <FieldRef ID="{47f68c3b-8930-406f-bde2-4a8c669ee87c}" Name="HasCustomEmailBody" />
      <FieldRef ID="{cb2413f2-7de9-4afc-8587-1ca3f563f624}" Name="SendEmailNotification" />
      <FieldRef ID="{4d2444c2-0e97-476c-a2a3-e9e4a9c73009}" Name="PendingModTime" />

    </FieldRefs>
    <XmlDocuments>
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
          <Display>ListForm</Display>
          <Edit>ListForm</Edit>
          <New>ListForm</New>
        </FormTemplates>
      </XmlDocument>
      <!--If you want to use custom Application Page,uncomment the following lines then modify the url.-->
      <!--<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
                <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
                    <Display>_layouts/yourProject/Display.aspx</Display>
                    <Edit>_layouts/yourProject/Approve.aspx</Edit>
                </FormUrls>
            </XmlDocument>-->
    </XmlDocuments>
  </ContentType>
</Elements>


Enjoy your day, Joe


Viewing all articles
Browse latest Browse all 11571

Trending Articles