共用方式為


FieldLookup.RelationshipDeleteBehavior 屬性

取得或設定值,指定查閱欄位的刪除行為。

命名空間:  Microsoft.SharePoint.Client
組件:   Microsoft.SharePoint.Client.Silverlight (在 Microsoft.SharePoint.Client.Silverlight.dll 中);  Microsoft.SharePoint.Client.Phone (在 Microsoft.SharePoint.Client.Phone.dll 中)  Microsoft.SharePoint.Client (在 Microsoft.SharePoint.Client.dll 中)

語法

'宣告
Public Property RelationshipDeleteBehavior As RelationshipDeleteBehaviorType
    Get
    Set
'用途
Dim instance As FieldLookup
Dim value As RelationshipDeleteBehaviorType

value = instance.RelationshipDeleteBehavior

instance.RelationshipDeleteBehavior = value
public RelationshipDeleteBehaviorType RelationshipDeleteBehavior { get; set; }

屬性值

類型:Microsoft.SharePoint.Client.RelationshipDeleteBehaviorType
傳回代表查閱欄位的刪除行為RelationshipDeleteBehaviorType執行個體。

例外狀況

例外狀況 條件
[Microsoft.SharePoint.SPException]

伺服器不允許變更欄位的內容。錯誤碼 ︰-2146232832。

[System.NotSupportedException]

外部清單,是欄位所屬的清單。錯誤碼:-1。

備註

RelationshipDeleteBehavior屬性可讓您強迫參考完整性時一份清單取決於另一份清單的兩個清單之間建立關聯。如果 [從屬參照] 清單中的查閱欄位RelationshipDeleteBehavior屬性設定為 [ Cascade,然後從來源清單中刪除的項目會產生所有相關的相依清單項目也會一併刪除。例如,假設您有相關的地址清單的客戶清單的地址] 清單中的查閱欄位。您可能會想要刪除的項目,讓所有相關項目也會一併刪除的地址的客戶。您無法完成的查閱欄位的RelationshipDeleteBehavior屬性設定Cascade地址清單中。

RelationshipDeleteBehavior屬性設定為Restrict可防止來源清單中的項目如果相依清單中的任何項目查閱其刪除。例如,假設您的客戶清單是查閱欄位中的訂單清單中的來源。您可以刪除客戶有待處理的訂單的 [客戶] 清單中的項目。在此情況下,您可以設定RelationshipDeleteBehavior屬性查閱欄位至Restrict等候中順序。

刪除條件約束會強制執行的查閱欄位必須能編製索引。RelationshipDeleteBehavior屬性設定為Cascade或Restrict之前, 先設定**Indexed()**屬性true。

重要

使用者必須具備上 [來源] 清單ManageLists權限,才能指定Cascade或Restrict。如需詳細資訊,請參閱BasePermissions列舉。

此外,您無法指定刪除限制式,如果 ︰

  • [查閱] 欄位可讓多個值。

    設定之前RelationshipDeleteBehavior屬性,請務必AllowMultipleValues屬性會傳回false。

  • [查閱] 欄位會指向其他網站的清單。

    核取 [查閱] 欄位的LookupWebId屬性的值。

  • 在清單中的項目數超過設定大型清單中的最大值。

    比較的 Web 應用程式的MaxItemsPerThrottledOperation屬性所傳回的值清單的ItemCount屬性傳回的值。

目前的使用者必須具備BasePermissions。目標清單當此屬性設定為RestrictManageLists權限。

請參閱

參照

FieldLookup 類別

FieldLookup 成員

Microsoft.SharePoint.Client 命名空間