Class ListExtensions
Class that provides generic list creation and manipulation methods
Inheritance
Namespace: Microsoft.SharePoint.Client
Assembly: PnP.Framework.dll
Syntax
public static class ListExtensions : object
Methods
AddIndexedPropertyBagKey(List, String)
Marks a property bag key for indexing
Declaration
public static bool AddIndexedPropertyBagKey(this List list, string key)
Parameters
List
list
The list to process |
System. The key to mark for indexing |
Returns
System. Returns True if succeeded |
AddRemoteEventReceiver(List, String, String, EventReceiverType, EventReceiverSynchronization, Boolean)
Registers a remote event receiver
Declaration
public static EventReceiverDefinition AddRemoteEventReceiver(this List list, string name, string url, EventReceiverType eventReceiverType, EventReceiverSynchronization synchronization, bool force)
Parameters
List
list
The list to process |
System. The name of the event receiver (needs to be unique among the event receivers registered on this list) |
System. The URL of the remote WCF service that handles the event |
Event
|
Event
|
System. If True any event already registered with the same name will be removed first. |
Returns
Event Returns an EventReceiverDefinition if succeeded. Returns null if failed. |
AddRemoteEventReceiver(List, String, String, EventReceiverType, EventReceiverSynchronization, Int32, Boolean)
Registers a remote event receiver
Declaration
public static EventReceiverDefinition AddRemoteEventReceiver(this List list, string name, string url, EventReceiverType eventReceiverType, EventReceiverSynchronization synchronization, int sequenceNumber, bool force)
Parameters
List
list
The list to process |
System. The name of the event receiver (needs to be unique among the event receivers registered on this list) |
System. The URL of the remote WCF service that handles the event |
Event
|
Event
|
System.
|
System. If True any event already registered with the same name will be removed first. |
Returns
Event Returns an EventReceiverDefinition if succeeded. Returns null if failed. |
AddWebhookSubscription(List, String, DateTime, String, String)
Add the a Webhook subscription to a list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static WebhookSubscription AddWebhookSubscription(this List list, string notificationUrl, DateTime expirationDate, string clientState = null, string accessToken = null)
Parameters
List
list
The list to add a Webhook subscription to |
System. The Webhook endpoint URL |
Date The expiration date of the subscription |
System. The client state to use in the Webhook subscription |
System. (optional) The access token to SharePoint |
Returns
Webhook The added subscription object |
AddWebhookSubscription(List, String, Int32, String, String)
Add the a Webhook subscription to a list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static WebhookSubscription AddWebhookSubscription(this List list, string notificationUrl, int validityInMonths = 6, string clientState = null, string accessToken = null)
Parameters
List
list
The list to add a Webhook subscription to |
System. The Webhook endpoint URL |
System. The validity of the subscriptions in months |
System. The client state to use in the Webhook subscription |
System. (optional) The access token to SharePoint |
Returns
Webhook The added subscription object |
ClearDefaultColumnValues(List)
Remove all default column values that are defined for this list.
Declaration
public static void ClearDefaultColumnValues(this List list)
Parameters
List
list
The list to process. |
ClearDefaultColumnValues(List, IEnumerable<IDefaultColumnValue>)
Removes the provided default column values from the specified folder(s) from list, if they were set.
Declaration
public static void ClearDefaultColumnValues(this List list, IEnumerable<IDefaultColumnValue> columnValues)
Parameters
List
list
The list to process. |
IEnumerable<IDefault The default column values that must be cleared. |
CreateDocumentLibrary(Web, String, Boolean, String)
Adds a document library to a web. Execute Query is called during this implementation
Declaration
public static List CreateDocumentLibrary(this Web web, string listName, bool enableVersioning = false, string urlPath = "")
Parameters
Web
web
Site to be processed - can be root web or sub site |
System. Name of the library |
System. Enable versioning on the list |
System. Path of the url |
Returns
List
|
CreateList(Web, Guid, Int32, String, Boolean, Boolean, String, Boolean)
Adds a custom list to a site
Declaration
public static List CreateList(this Web web, Guid featureId, int listType, string listName, bool enableVersioning, bool updateAndExecuteQuery = true, string urlPath = "", bool enableContentTypes = false)
Parameters
Web
web
Site to be processed - can be root web or sub site |
Guid
featureId
Feature that contains the list template |
System. Type ID of the list, within the feature |
System. Name of the list |
System. Enable versioning on the list |
System. (Optional) Perform list update and executequery, defaults to true |
System. (Optional) URL to use for the list |
System. (Optional) Enable content type management |
Returns
List
The newly created list |
CreateList(Web, ListTemplateType, String, Boolean, Boolean, String, Boolean, Boolean)
Adds a default list to a site
Declaration
public static List CreateList(this Web web, ListTemplateType listType, string listName, bool enableVersioning, bool updateAndExecuteQuery = true, string urlPath = "", bool enableContentTypes = false, bool hidden = false)
Parameters
Web
web
Site to be processed - can be root web or sub site |
List Built in list template type |
System. Name of the list |
System. Enable versioning on the list |
System. (Optional) Perform list update and executequery, defaults to true |
System. (Optional) URL to use for the list |
System. (Optional) Enable content type management |
System. (Optional) Hide the list from the SharePoint UI |
Returns
List
The newly created list |
CreateView(List, String, ViewType, String[], UInt32, Boolean, String, Boolean, Boolean)
Create view to existing list
Declaration
public static View CreateView(this List list, string viewName, ViewType viewType, string[] viewFields, uint rowLimit, bool setAsDefault, string query = null, bool personal = false, bool paged = false)
Parameters
List
list
List to process |
System. Name of the view |
View Type of the view |
System. Fields of the view |
System. Row limit of the view |
System. Set as default view |
System. Query for view creation |
System. Personal View |
System. Paged view |
Returns
View
|
CreateViewsFromXML(List, XmlDocument)
Actual implementation of the view creation logic based on given xml
Declaration
public static void CreateViewsFromXML(this List list, XmlDocument xmlDoc)
Parameters
List
list
List to process |
Xml XmlDocument object |
CreateViewsFromXML(Web, String, XmlDocument)
Create list views based on xml structure loaded to memory
Declaration
public static void CreateViewsFromXML(this Web web, string listUrl, XmlDocument xmlDoc)
Parameters
Web
web
Web to process |
System. List Url |
Xml XmlDocument object |
CreateViewsFromXMLFile(List, String)
Create list views based on specific xml structure in external file
Declaration
public static void CreateViewsFromXMLFile(this List list, string filePath)
Parameters
List
list
List to process |
System. Path of the file |
CreateViewsFromXMLFile(Web, String, String)
Creates list views based on specific xml structure from file
Declaration
public static void CreateViewsFromXMLFile(this Web web, string listUrl, string filePath)
Parameters
Web
web
Web to process |
System. List Url |
System. Path of the file |
CreateViewsFromXMLString(List, String)
Create list views based on specific xml structure in string
Declaration
public static void CreateViewsFromXMLString(this List list, string xmlString)
Parameters
List
list
List to process |
System. XML string to create view |
CreateViewsFromXMLString(Web, String, String)
Creates views based on specific xml structure from string
Declaration
public static void CreateViewsFromXMLString(this Web web, string listUrl, string xmlString)
Parameters
Web
web
Web to process |
System. List Url |
System. Path of the file |
EnableClassicAudienceTargeting(List)
Enable Classic Audience Targeting on a List
Declaration
public static void EnableClassicAudienceTargeting(this List list)
Parameters
List
list
|
EnableModernAudienceTargeting(List)
Declaration
public static void EnableModernAudienceTargeting(this List list)
Parameters
List
list
|
GetDefaultColumnValues(List)
Gets default values for column values.
The returned list contains one dictionary per default setting per folder.
Each dictionary has the following keys set: Path, Field, Value
Path: Relative path to the library/folder
Field: Internal name of the field which has a default value
Value: The default value for the field
Declaration
public static List<Dictionary<string, string>> GetDefaultColumnValues(this List list)
Parameters
List
list
List to process |
Returns
List<Dictionary<System.
|
GetEventReceiverById(List, Guid)
Returns an event receiver definition
Declaration
public static EventReceiverDefinition GetEventReceiverById(this List list, Guid id)
Parameters
List
list
The target list |
Guid
id
Id of the event receiver |
Returns
Event
|
GetEventReceiverByName(List, String)
Returns an event receiver definition
Declaration
public static EventReceiverDefinition GetEventReceiverByName(this List list, string name)
Parameters
List
list
The list to process |
System. Name of the event receiver |
Returns
Event
|
GetIndexedPropertyBagKeys(List)
Returns all keys in the property bag that have been marked for indexing
Declaration
public static IEnumerable<string> GetIndexedPropertyBagKeys(this List list)
Parameters
List
list
The list to process |
Returns
IEnumerable<System. all indexed property bag keys |
GetListById(Web, Guid, Expression<Func<List, Object>>[])
Get List by using Id
Declaration
public static List GetListById(this Web web, Guid listId, params Expression<Func<List, object>>[] expressions)
Parameters
Web
web
The web containing the list |
Guid
listId
The Id of the list |
Expression<Func<List, System. Additional list of lambda expressions of properties to load alike l => l.BaseType |
Returns
List
Loaded list instance matching specified Id |
GetListByTitle(Web, String, Expression<Func<List, Object>>[])
Get list by using Title
Declaration
public static List GetListByTitle(this Web web, string listTitle, params Expression<Func<List, object>>[] expressions)
Parameters
Web
web
Site to be processed - can be root web or sub site |
System. Title of the list to return |
Expression<Func<List, System. Additional list of lambda expressions of properties to load alike l => l.BaseType |
Returns
List
Loaded list instance matching to title or null |
GetListByUrl(Web, String, Expression<Func<List, Object>>[])
Get list by using Url
Declaration
public static List GetListByUrl(this Web web, string webRelativeUrl, params Expression<Func<List, object>>[] expressions)
Parameters
Web
web
Web (site) to be processed |
System. Url of list relative to the web (site), e.g. lists/testlist |
Expression<Func<List, System. Additional list of lambda expressions of properties to load alike l => l.BaseType |
Returns
List
Returns list if found, null if no list is found. |
GetListID(Web, String)
Returns the GUID id of a list
Declaration
public static Guid GetListID(this Web web, string listName)
Parameters
Web
web
Site to be processed - can be root web or sub site |
System. List to operate on |
Returns
Guid
|
GetPagesLibrary(Web)
Gets the publishing pages library of the web based on site language
Declaration
public static List GetPagesLibrary(this Web web)
Parameters
Web
web
The web. |
Returns
List
The publishing pages library. Returns null if library was not found. |
GetPropertyBagValueDateTime(List, String, DateTime)
Get DateTime typed property bag value. If does not contain, returns default value.
Declaration
public static DateTime? GetPropertyBagValueDateTime(this List list, string key, DateTime defaultValue)
Parameters
List
list
The list to process |
System. Key of the property bag entry to return |
Date
|
Returns
System. Value of the property bag entry as integer |
GetPropertyBagValueInt(List, String, Int32)
Get int typed property bag value. If does not contain, returns default value.
Declaration
public static int? GetPropertyBagValueInt(this List list, string key, int defaultValue)
Parameters
List
list
List to read the property bag value from |
System. Key of the property bag entry to return |
System. Default value of the property bag |
Returns
System. Value of the property bag entry as integer |
GetPropertyBagValueString(List, String, String)
Get string typed property bag value. If does not contain, returns given default value.
Declaration
public static string GetPropertyBagValueString(this List list, string key, string defaultValue)
Parameters
List
list
List to read the property bag value from |
System. Key of the property bag entry to return |
System. Default value of the property bag |
Returns
System. Value of the property bag entry as string |
GetViewById(List, Guid, Expression<Func<View, Object>>[])
Gets a view by Id
Declaration
public static View GetViewById(this List list, Guid id, params Expression<Func<View, object>>[] expressions)
Parameters
List
list
List to process |
Guid
id
Id to the view to extract |
Expression<Func<View, System. List of lambda expressions of properties to load when retrieving the object |
Returns
View
returns null if not found |
GetViewByName(List, String, Expression<Func<View, Object>>[])
Gets a view by Name
Declaration
public static View GetViewByName(this List list, string name, params Expression<Func<View, object>>[] expressions)
Parameters
List
list
List to process |
System. Name of the view |
Expression<Func<View, System. List of lambda expressions of properties to load when retrieving the object |
Returns
View
returns null if not found |
GetWebhookSubscriptions(List, String)
Get all the existing Webhooks subscriptions of the list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static IList<WebhookSubscription> GetWebhookSubscriptions(this List list, string accessToken = null)
Parameters
List
list
The list to get the subscriptions of |
System. (optional) The access token to SharePoint |
Returns
IList<Webhook The collection of Webhooks subscriptions of the list |
GetWebhookSubscriptionsAsync(List, String)
Async get all the existing Webhooks subscriptions of the list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static async Task<IList<WebhookSubscription>> GetWebhookSubscriptionsAsync(this List list, string accessToken = null)
Parameters
List
list
The list to get the subscriptions of |
System. (optional) The access token to SharePoint |
Returns
Task<IList<Webhook The collection of Webhooks subscriptions of the list |
GetWebRelativeUrl(List)
Gets the web relative URL.
Allow users to get the web relative URL of a list.
This is useful when exporting lists as it can then be used as a parameter to Web.GetListByUrl().
Declaration
public static string GetWebRelativeUrl(this List list)
Parameters
List
list
The list to export the URL of. |
Returns
System. The web relative URL of the list. |
IsCreatedFromTemplate(List)
Declaration
public static bool IsCreatedFromTemplate(this List list)
Parameters
List
list
|
Returns
System.
|
ListExists(Web, Guid)
Checks if list exists on the particular site based on the list id property.
Declaration
public static bool ListExists(this Web web, Guid id)
Parameters
Web
web
Site to be processed - can be root web or sub site |
Guid
id
The id of the list to be checked. |
Returns
System. True if the list exists |
ListExists(Web, String)
Checks if list exists on the particular site based on the list Title property.
Declaration
public static bool ListExists(this Web web, string listTitle)
Parameters
Web
web
Site to be processed - can be root web or sub site |
System. Title of the list to be checked. |
Returns
System. True if the list exists |
ListExists(Web, Uri)
Checks if list exists on the particular site based on the list's site relative path.
Declaration
public static bool ListExists(this Web web, Uri siteRelativeUrlPath)
Parameters
Web
web
Site to be processed - can be root web or sub site |
Uri
siteRelativeUrlPath
Site relative path of the list |
Returns
System. True if the list exists |
PropertyBagContainsKey(List, String)
Checks if the given property bag entry exists
Declaration
public static bool PropertyBagContainsKey(this List list, string key)
Parameters
List
list
List to be processed |
System. Key of the property bag entry to check |
Returns
System. True if the entry exists, false otherwise |
ReIndexList(List)
Queues a list for a full crawl the next incremental crawl
Declaration
public static void ReIndexList(this List list)
Parameters
List
list
List to process |
RemoveContentTypeByName(List, String)
Removes a content type from a list/library by name
Declaration
public static void RemoveContentTypeByName(this List list, string contentTypeName)
Parameters
List
list
The list |
System. The content type name to remove from the list |
RemoveIndexedPropertyBagKey(List, String)
Unmarks a property bag key for indexing
Declaration
public static bool RemoveIndexedPropertyBagKey(this List list, string key)
Parameters
List
list
The list to process |
System. The key to unmark for indexed. Case-sensitive |
Returns
System. Returns True if succeeded |
RemovePropertyBagValue(List, String)
Removes a property bag value from the property bag
Declaration
public static void RemovePropertyBagValue(this List list, string key)
Parameters
List
list
The list to process |
System. The key to remove |
RemoveWebhookSubscription(List, Guid, String)
Remove a Webhook subscription from the list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static bool RemoveWebhookSubscription(this List list, Guid subscriptionId, string accessToken = null)
Parameters
List
list
The list to remove the Webhook subscription from |
Guid
subscriptionId
The id of the subscription to remove |
System. (optional) The access token to SharePoint |
Returns
System.
|
RemoveWebhookSubscription(List, WebhookSubscription, String)
Remove a Webhook subscription from the list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static bool RemoveWebhookSubscription(this List list, WebhookSubscription subscription, string accessToken = null)
Parameters
List
list
The list to remove the Webhook subscription from |
Webhook The subscription to remove |
System. (optional) The access token to SharePoint |
Returns
System.
|
RemoveWebhookSubscription(List, String, String)
Remove a Webhook subscription from the list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static bool RemoveWebhookSubscription(this List list, string subscriptionId, string accessToken = null)
Parameters
List
list
The list to remove the Webhook subscription from |
System. The id of the subscription to remove |
System. (optional) The access token to SharePoint |
Returns
System.
|
SetDefaultColumnValues(List, IEnumerable<IDefaultColumnValue>)
Sets default values for column values.
In order to for instance set the default Enterprise Metadata keyword field to a term, add the enterprise metadata keyword to a library (internal name "TaxKeyword")
Column values are defined by the DefaultColumnValue class that has 3 properties:
RelativeFolderPath : / to set a default value for the root of the document library, or /foldername to specify a subfolder
FieldInternalName : The name of the field to set. For instance "TaxKeyword" to set the Enterprise Metadata field
Terms : A collection of Taxonomy terms to set
Supported column types: Metadata, Text, Choice, MultiChoice, People, Boolean, DateTime, Number, Currency
Declaration
public static void SetDefaultColumnValues(this List list, IEnumerable<IDefaultColumnValue> columnValues)
Parameters
List
list
List to process |
IEnumerable<IDefault Column Values |
SetDefaultColumnValues(List, IEnumerable<IDefaultColumnValue>, Boolean)
Sets default values for column values.
In order to for instance set the default Enterprise Metadata keyword field to a term, add the enterprise metadata keyword to a library (internal name "TaxKeyword")
Column values are defined by the DefaultColumnValue class that has 3 properties:
RelativeFolderPath : / to set a default value for the root of the document library, or /foldername to specify a subfolder
FieldInternalName : The name of the field to set. For instance "TaxKeyword" to set the Enterprise Metadata field
Terms : A collection of Taxonomy terms to set
Supported column types: Metadata, Text, Choice, MultiChoice, People, Boolean, DateTime, Number, Currency
Declaration
public static void SetDefaultColumnValues(this List list, IEnumerable<IDefaultColumnValue> columnValues, bool overwriteExistingDefaultColumnValues)
Parameters
List
list
The list to process. |
IEnumerable<IDefault The default column values. |
System. If true, the currrent default column values will be overwritten. |
SetJSLinkCustomizations(List, PageType, String)
Sets JS link customization for a list form
Declaration
public static void SetJSLinkCustomizations(this List list, PageType pageType, string jslink)
Parameters
List
list
SharePoint list |
Page Type of form |
System. JSLink to set to the form. Set to empty string to remove the set JSLink customization. Specify multiple values separated by pipe symbol. For e.g.: ~sitecollection/_catalogs/masterpage/jquery-2.1.0.min.js|~sitecollection/_catalogs/masterpage/custom.js |
SetJSLinkCustomizations(List, String, String)
Sets JS link customization for a list view page
Declaration
public static void SetJSLinkCustomizations(this List list, string serverRelativeUrl, string jslink)
Parameters
List
list
SharePoint list |
System. url of the view page |
System. JSLink to set to the form. Set to empty string to remove the set JSLink customization. Specify multiple values separated by pipe symbol. For e.g.: ~sitecollection/_catalogs/masterpage/jquery-2.1.0.min.js|~sitecollection/_catalogs/masterpage/custom.js |
SetListPermission(List, BuiltInIdentity, RoleType)
Set custom permission to the list
Declaration
public static void SetListPermission(this List list, BuiltInIdentity user, RoleType roleType)
Parameters
List
list
List on which permission to be set |
Built Built in user |
Role Role type |
SetListPermission(List, Principal, RoleType)
Set custom permission to the list
Declaration
public static void SetListPermission(this List list, Principal principal, RoleType roleType)
Parameters
List
list
List on which permission to be set |
Principal
principal
SharePoint Group or User |
Role Role type |
SetLocalizationLabelsForList(List, String, String, String)
Can be used to set translations for different cultures.
Declaration
public static void SetLocalizationLabelsForList(this List list, string cultureName, string titleResource, string descriptionResource)
Parameters
List
list
List to be processed |
System. Culture name like en-us or fi-fi |
System. Localized Title string |
System. Localized Description string |
Examples
list.SetLocalizationForSiteLabels("fi-fi", "Name of the site in Finnish", "Description in Finnish");
SetLocalizationLabelsForList(Web, String, String, String, String)
Can be used to set translations for different cultures. http://blogs.msdn.com/b/vesku/archive/2014/03/20/office365-multilingual-content-types-site-columns-and-site-other-elements.aspx
Declaration
public static void SetLocalizationLabelsForList(this Web web, string listTitle, string cultureName, string titleResource, string descriptionResource)
Parameters
Web
web
Site to be processed - can be root web or sub site |
System. Title of the list |
System. Culture name like en-us or fi-fi |
System. Localized Title string |
System. Localized Description string |
SetPropertyBagValue(List, String, DateTime)
Sets a key/value pair in the list property bag
Declaration
public static void SetPropertyBagValue(this List list, string key, DateTime value)
Parameters
List
list
The list to process |
System. Key for the property bag entry |
Date Datetime value for the property bag entry |
SetPropertyBagValue(List, String, Int32)
Sets a key/value pair in the list property bag
Declaration
public static void SetPropertyBagValue(this List list, string key, int value)
Parameters
List
list
The list to process |
System. Key for the property bag entry |
System. Integer value for the property bag entry |
SetPropertyBagValue(List, String, String)
Sets a key/value pair in the list property bag
Declaration
public static void SetPropertyBagValue(this List list, string key, string value)
Parameters
List
list
List that will hold the property bag entry |
System. Key for the property bag entry |
System. String value for the property bag entry |
UpdateListVersioning(List, Boolean, Boolean, Boolean)
Enable/disable versioning on a list
Declaration
public static void UpdateListVersioning(this List list, bool enableVersioning, bool enableMinorVersioning = true, bool updateAndExecuteQuery = true)
Parameters
List
list
List to be processed |
System. True to enable versioning, false to disable |
System. Enable/Disable minor versioning |
System. Perform list update and executequery, defaults to true |
UpdateListVersioning(Web, String, Boolean, Boolean, Boolean)
Enable/disable versioning on a list
Declaration
public static void UpdateListVersioning(this Web web, string listName, bool enableVersioning, bool enableMinorVersioning = true, bool updateAndExecuteQuery = true)
Parameters
Web
web
Site to be processed - can be root web or sub site |
System. List to operate on |
System. True to enable versioning, false to disable |
System. Enable/Disable minor versioning |
System. Perform list update and executequery, defaults to true |
UpdateTaxonomyFieldDefaultValue(Web, String, String, Guid, Boolean)
Sets the default value for a managed metadata column in the specified list. This operation will not change existing items in the list.
Declaration
public static void UpdateTaxonomyFieldDefaultValue(this Web web, string listName, string fieldInternalName, Guid termGuid, bool systemUpdate = false)
Parameters
Web
web
Extension web |
System. Name of list which contains the managed metadata field of which the default needs to be set |
System. Internal name of the managed metadata field for which the default needs to be set |
Guid
termGuid
Term Guid of the Term which represents the managed metadata item which should be set as the default |
System. If set to true, will do a system udpate to the item. Default value is false. |
UpdateTaxonomyFieldDefaultValue(Web, String, String, String, Guid, Guid, Boolean)
Sets the default value for a managed metadata column in the specified list. This operation will not change existing items in the list.
Declaration
public static void UpdateTaxonomyFieldDefaultValue(this Web web, string termName, string listName, string fieldInternalName, Guid groupGuid, Guid termSetGuid, bool systemUpdate = false)
Parameters
Web
web
Extension web |
System. Name of a specific term which should be set as the default on the managed metadata field |
System. Name of list which contains the managed metadata field of which the default needs to be set |
System. Internal name of the managed metadata field for which the default needs to be set |
Guid
groupGuid
TermGroup Guid of the Term Group which contains the managed metadata item which should be set as the default |
Guid
termSetGuid
TermSet Guid of the Term Set which contains the managed metadata item which should be set as the default |
System. If set to true, will do a system udpate to the item. Default value is false. |
UpdateTaxonomyFieldDefaultValue(Web, String, String, Term, Boolean)
Sets the default value for a managed metadata column in the specified list. This operation will not change existing items in the list.
Declaration
public static void UpdateTaxonomyFieldDefaultValue(this Web web, string listName, string fieldInternalName, Term term, bool systemUpdate = false)
Parameters
Web
web
Extension web |
System. Name of list which contains the managed metadata field of which the default needs to be set |
System. Internal name of the managed metadata field for which the default needs to be set |
Term
term
Managed metadata Term which represents the managed metadata item which should be set as the default |
System. If set to true, will do a system udpate to the item. Default value is false. |
UpdateWebhookSubscription(List, Guid, DateTime, String)
Updates a Webhook subscription from the list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static bool UpdateWebhookSubscription(this List list, Guid subscriptionId, DateTime expirationDateTime, string accessToken = null)
Parameters
List
list
The list to remove the Webhook subscription from |
Guid
subscriptionId
The id of the subscription to remove |
Date New web hook expiration date |
System. (optional) The access token to SharePoint |
Returns
System.
|
UpdateWebhookSubscription(List, Guid, String, DateTime, String)
Updates a Webhook subscription from the list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static bool UpdateWebhookSubscription(this List list, Guid subscriptionId, string webHookEndPoint, DateTime expirationDateTime, string accessToken = null)
Parameters
List
list
The list to remove the Webhook subscription from |
Guid
subscriptionId
The id of the subscription to remove |
System. Url of the web hook service endpoint (the one that will be called during an event) |
Date New web hook expiration date |
System. (optional) The access token to SharePoint |
Returns
System.
|
UpdateWebhookSubscription(List, WebhookSubscription, String)
Updates a Webhook subscription from the list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static bool UpdateWebhookSubscription(this List list, WebhookSubscription subscription, string accessToken = null)
Parameters
List
list
The list to remove the Webhook subscription from |
Webhook The subscription to update |
System. (optional) The access token to SharePoint |
Returns
System.
|
UpdateWebhookSubscription(List, String, String, DateTime, String)
Updates a Webhook subscription from the list Note: If the access token is not specified, it will cost a dummy request to retrieve it
Declaration
public static bool UpdateWebhookSubscription(this List list, string subscriptionId, string webHookEndPoint, DateTime expirationDateTime, string accessToken = null)
Parameters
List
list
The list to remove the Webhook subscription from |
System. The id of the subscription to remove |
System. Url of the web hook service endpoint (the one that will be called during an event) |
Date New web hook expiration date |
System. (optional) The access token to SharePoint |
Returns
System.
|