I am creating custom calendar list with content type and with some custom columns, here I don't want some default columns/fields from calendar list like location,category,all day event...etc, I have removed these fromlist but still these are visible when am going to create new event like bellow snaps
3 Answers
Follow the below steps:
- Go to List settings from ribbon in Calendar tab.
- Go to Advanced settings under General settings.
- Select "Yes" in Allow management of content types? and click OK button.
- Now you can see the Event content type under Content Types section. (You can choose your content type from which you want to hide the column)
- Now You can see the list of the columns, select column you want to hide and select Hidden (Will not appear in forms) and click OK button.
Now that column will be hidden from the form.
Open the Elements.xml file of the content type. Set Inherits
to FALSE
. Then add each of the columns which you want to remove from the content type in <FieldRefs>
section. Use RemoveFieldRef
property to hide the field. Example:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Event (0x0102) -->
<ContentType ID="0x010200B5BDA8DA0B8944F0AE8ACE1A38228A59" Name="Holiday" Group="Custom Content Types" Description="My Content Type" Inherits="FALSE" Version="0">
<FieldRefs>
<RemoveFieldRef ID="{288f5f32-8462-4175-8f09-dd7ba29359a9}" Name="Location" />
</FieldRefs>
</ContentType>
</Elements>
Update based on comment
The GUID of the out of the box fields in above XML can be retrieved in many ways:
- The fields will be present in xml files in this location: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\FEATURES\fields
- The other easy way is to temporarily create a List in Visual studio using List option and selecting Calendar as the type. Once the list is created, open the schema.xml file and find the fields which you want to remove, copy their GUIDs.
-
from where i supposed get this ID="{288F5F32-8462-4175-8F09-DD7BA29359A9}" or simply needs to create GUID in through visual studio and plcing it there along with field name which i want to remove Aug 23, 2016 at 8:54
-
-
i tried this but it is not working ,i have my custom columns inside content type within <FieldRefs> <FieldRef ID="{deb7c838-8093-407a-b979-8a8599f9d557}" DisplayName="Name" Required="FALSE" Name="Name" /></FieldRefs> so here within my custom columns i have added <RemoveFieldRef ID="{288f5f32-8462-4175-8f09-dd7ba29359a9}" Name="Location" /> and then it shows only custom columns while creating new event Aug 23, 2016 at 9:59
-
Isn't that what you want. Per your requirements, you didn't want columns like Location Aug 23, 2016 at 10:01
-
yes but it removes all default columns including title,start time,end time means romes those columns which i didn't mentioned there. Aug 23, 2016 at 10:10
- List Settings
- Under Content Types, click Event
- Click on the column name you want hidden
- Select under "This column is:" Hidden (Will not appear in forms)
Presto Chango... It is done.