関係:「ターゲットリストに1つ以上の存在しない項目を参照する値が含まれているため、参照整合性のエラー

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/4691

  •  16-10-2019
  •  | 
  •  

質問

私がこのような参照整合性を実施しようとするとき:

fieldLookup.Indexed = true;
fieldLookup.RelationshipDeleteBehavior = SPRelationshipDeleteBehavior.Restrict
fieldLookup.Update()

私のアプリのすべてのフィールドではありませんが、ほとんどの場合は機能します。失敗したとき、それは次のように見えます:

Microsoft.SharePoint.SPException: This lookup column cannot enforce a relationship behavior because it contains values that reference one ore more non-existent items in the target list. 
---> System.Runtime.InteropServices.COMException (0x810705B0): 
<nativehr>0x810705b0</nativehr><nativestack></nativestack>This lookup column cannot enforce a relationship behavior because it contains values that reference one ore more non-existent items in the target list.
  at Microsoft.SharePoint.Library.SPRequestInternalClass.UpdateField(String bstrUrl, String bstrListName, String bstrXML)
  at Microsoft.SharePoint.Library.SPRequest.UpdateField(String bstrUrl, String bstrListName, String bstrXML)
  --- End of inner exception stack trace ---
  at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
  at Microsoft.SharePoint.Library.SPRequest.UpdateField(String bstrUrl, String bstrListName, String bstrXML)
  at Microsoft.SharePoint.SPField.UpdateCore(Boolean bToggleSealed)
  at Microsoft.SharePoint.SPField.Update()
  at MyApp.Features.Service.EntityBuilder.EntityBuilderBase.EnforceReferentialIntegrity()

ちなみに、ブラウザ内のフィールドのプロパティで「関係行動を施行」をクリックすると、まったく同じエラーが表示されます。

私はリフレクターを見ましたが、このエラーは管理されていないコードで発生しているので、誰かが追加のデバッグ技術を提供できれば同じくらい幸せです。

ありがとう、 - リー

役に立ちましたか?

解決

リストにはすでにアイテムが含まれていますか?これは、2つの空のリストを設定するときに最適に機能します。

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top