Skip to content

Commit c817739

Browse files
authored
New CSOM doc for retention labels
Re-submitting to correct repo; new assets for use of CSOM methods for retention label features
1 parent d5cdb96 commit c817739

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
author: kyracatwork
3+
ms.author: kyrachurney
4+
ms.date: 4/18/2023
5+
title: CSOM methods for applying retention labels (setting ComplianceTags)
6+
description: CSOM methods are available to apply (set) a retention label (ComplianceTag) on one or many items (ListItems) in SharePoint.
7+
---
8+
9+
# CSOM methods for applying retention labels (setting ComplianceTags)
10+
11+
Retention labels let you apply retention settings for governance control at the item level, and are part of the Microsoft Purview compliance solutions. [Learn more about retention labels.](/microsoft-365/compliance/retention?view=o365-worldwide#retention-labels)
12+
13+
Retention labels may classify contents as records, which place restrictions on what actions are allowed or blocked. [Learn more about declaring records by using retention labels](/microsoft-365/compliance/declare-records)
14+
15+
CSOM methods are available to apply (set) a retention label (ComplianceTag) on one or many items (ListItems) in SharePoint.
16+
17+
> [!IMPORTANT]
18+
> Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
19+
20+
## SetComplianceTagOnBulkItems
21+
This method can be used to set a ComplianceTag on one or many ListItems. It is strongly recommended to use this method for this purpose.
22+
23+
<!-- {
24+
"blockType": "ignored"
25+
}
26+
-->
27+
```c#
28+
public List<int> SetComplianceTagOnBulkItems(
29+
List<int> itemIds,
30+
string listUrl,
31+
string complianceTagValue)
32+
```
33+
34+
### Parameters
35+
'List' [Int](/en-us/dotnet/api/system.int32)
36+
37+
'ItemsIds' [String](/dotnet/api/system.string)
38+
39+
'ListURL' [String](/dotnet/api/system.string)
40+
41+
'ComplianceTagValue' [String](/dotnet/api/system.string)
42+
43+
Attribute [RemoteAttribute](/dotnet/api/microsoft.sharepoint.client.remoteattribute)
44+
45+
### Applies to
46+
47+
|Product|Versions|
48+
|:---|:---|
49+
|SharePoint CSOM|latest|
50+
51+
52+
53+
## Other
54+
> [!NOTE] It is strongly recommended to use SetComplianceTagOnBulkItems instead of these methods.
55+
56+
The following methods are also available, but are no longer updated and may be subject to deprecation in the future. If you are using these methods, we strongly recommend use of the SetComplianceTagOnBulkItems method instead.
57+
58+
* [SetComplianceTag](/dotnet/api/microsoft.sharepoint.client.listitem.setcompliancetag?view=sharepoint-csom)
59+
60+
* [SetComplianceTagWithExplicitMetaInfo](/dotnet/api/microsoft.sharepoint.client.listitem.setcompliancetagwithexplicitmetainfo?view=sharepoint-csom)
61+
62+
* [SetComplianceTagWithExplicitMetasUpdate](https://learn.microsoft.com/en-us/dotnet/api/microsoft.sharepoint.client.listitem.setcompliancetagwithexplicitmetasupdate?view=sharepoint-csom)
63+
64+
* [SetComplianceTagWithHold](/dotnet/api/microsoft.sharepoint.client.listitem.setcompliancetagwithhold?view=sharepoint-csom)
65+
66+
* [SetComplianceTagWithMetaInfo](/dotnet/api/microsoft.sharepoint.client.listitem.setcompliancetagwithmetainfo?view=sharepoint-csomtnet/api/microsoft.sharepoint.client.listitem.setcompliancetagwithhold?view=sharepoint-csom)
67+
68+
* [SetComplianceTagWithNoHold](/dotnet/api/microsoft.sharepoint.client.listitem.setcompliancetagwithnohold?view=sharepoint-csom)
69+
70+
* [SetComplianceTagWithRecord](/dotnet/api/microsoft.sharepoint.client.listitem.setcompliancetagwithrecord?view=sharepoint-csom)
71+
72+
73+
74+
75+
76+
77+
78+
79+
80+
81+
82+
83+

0 commit comments

Comments
 (0)