Table of contents
TOC
Collapse the table of content
Expand the table of content

FieldAndContentTypeExtensions.AddFieldToContentType Method

SharePoint Dev Documents|Last Updated: 5/20/2017
|
1 Contributor

Associates field to content type

Namespace:Microsoft.SharePoint.Client
Assembly: OfficeDevPnP.Core.dll

Syntax

public static void AddFieldToContentType(this Web web, ContentType contentType, Field field, Boolean required = False, Boolean hidden = False)

Parameters

web

  Type: Microsoft.SharePoint.Client.Web
  Site to be processed - can be root web or sub site

contentType

  Type: Microsoft.SharePoint.Client.ContentType
  Content type to associate field to

field

  Type: Microsoft.SharePoint.Client.Field
  Field to associate to the content type

(optional) required

  Type: System.Boolean
  Optionally make this a required field

(optional) hidden

  Type: System.Boolean
  Optionally make this a hidden field

Return Value

Type: void

See also

© 2018 Microsoft