6

I've created a custom site content type that extends from Event. But I can't figure out how to hide the "All Day Event" and "Recurrence" columns for all lists using my custom content type.

enter image description here

17

No Code Solution (without Powershell and SharePoint Designer) to "hide Recurrence field" or "hide AllDayEvent field":

  1. go to list settings
  2. go to your event content type
  3. click on some field to edit
  4. the url will now look something like: https://xxx.sharepoint.com/sites/01/_layouts/15/ManageContentTypeField.aspx?ctype=0x0102005387B5A54CC55F43AF64A0B67EBB8CE2&List=a1b74248-bc1f-48ce-9bfd-02c7ab696931&Field=Category&Fid=%7B6df9bd52-550e-4a30-bc31-a4366832a87d%7D
  5. now remove the "Fid" Parameter and replace "Field" Parameter value with either "fRecurrence" or "fAllDayEvent"
  6. now you can edit the field and make it hidden so it won't appear in any form
  • Hahahah! Beautifull, nice hack! :) Works like a charm – Gennady G Jun 29 '17 at 9:29
5

You cannot do this with the UI, but you can do it with PowerShell or C# code. The internal names of the columns are fRecurrence and fAllDayEvent and the property you want to set is Hidden. So you can update the associated FieldLinks of the Content Type with code like this (PowerShell):

$ctype = $myList.ContentTypes["Event"]
$ctype.FieldLinks["fRecurrence"].Hidden = $True
$ctype.FieldLinks["fAllDayEvent"].Hidden = $True
$ctype.Update()
2

The fields can be hidden at the content type level using SharePoint Designer.

  1. Create a custom content type based on the Event content type.
  2. Open SharePoint Designer.
  3. In the Navigation pane on the left, click Content Types.
  4. Select the content type created in step 1.
  5. In the ribbon, on the Content Type Settings tab, click Edit Columns.
  6. Locate the All Day Event field, and click Optional in its Property column. This activates the property drop down.
  7. Select Hidden in the dropdown.
  8. For the Recurrence field follow step 6 and step 7.
  9. Click Save.
  10. Go back to your browser and add the content type to a calendar list. The fields will be hidden.
1

I had to set Showindisplayform to false also

$web = Get-SPWeb "https://sitename"
$list = $web.Lists["List Name"]
$ctype = $list.ContentTypes["Content Type Name"]
$ctype.FieldLinks["fRecurrence"].Hidden = $true
$ctype.FieldLinks["fRecurrence"].ShowInDisplayForm = $false
$ctype.Update()
0

Here's how I did it in SharePoint Online: I created a new site content type, but I based it off the List > Item content type. I added the content type to the calendar, then I added from the existing site or list columns. I didn't include Recurrence. Sorted!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.