0

If list A has a SPFieldLookup to list B is there any thing in list B's SPList object to show the relationship with list A?

While I can flip through list A's fields and find the relationship to List B in a SPFieldLookup, I can't determine how to programmatically link List B back to List A.

  • For what reason do you need to do this? What goal are you trying to achieve with this? – RJ Cuthbertson Feb 27 '13 at 1:54
  • @rjcup3 Why would an answer to your questions help find an answer? – iambriansreed Feb 28 '13 at 13:37
  • There is no way to determine programmatically from the object model of list B, which other lists have lookups to it. If you're trying to prevent deletion of a column that has dependencies there are ways to enforce that. If you're trying to achieve something else, there may be a better way to organize the data. The reason I asked is because the answer to your question is "no", but there has to be an underlying reason that you asked your question in the first place, and that may have an actual answer. – RJ Cuthbertson Feb 28 '13 at 15:01
0

No. As is stated in the comment by @RJ Cuthbertson:

There is no way to determine programmatically from the object model of list B, which other lists have lookups to it. If you're trying to prevent deletion of a column that has dependencies there are ways to enforce that. If you're trying to achieve something else, there may be a better way to organize the data. The reason I asked is because the answer to your question is "no", but there has to be an underlying reason that you asked your question in the first place, and that may have an actual answer.

0

In list B you cand find GetRelatedFields method:

Returns a collection of lookup fields that use this list as a data source and that have FieldLookup.IsRelationship set to true.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.