0
votes

I have a sharepoint list, for example it is named as SourceList. I also have several lists which are associated to SourceList via lookup fields. I don't know the names or number of these lists\ they are created and being created dynamically. And any time a new list associated to SourceList can be created.

So, how can i get the lists associated to SourceList programmatically by Sharepoint object model? I know that i can iterate through lists and also the fields of the lists to check if it is a lookup field and associated to my SourceList. I don't want to do this for performance concerns but it will be my last chance if i can't find a better solution. And also i know i can query sharepoint db directly to get these lists but i will never want to do this.

Thanks.

1

1 Answers

0
votes

You basically just need to access the list then the lookup field which should be of type SPFieldLookup when you have this object the source list will be the LookupList property on that field.

They have a good example in this link:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldlookup.aspx