views:

8721

answers:

11

I need to create some functionality in our SharePoint app that populates a list or lists with some simple hierarchical data. Each parent record will represent a "submission" and each child record will be a "submission item." There's a 1-to-n relationship between submissions and submission items. Is this practical to do in SharePoint? The only types of list relationships I've done so far are lookup columns, but this seems a bit different. Also, once such a list relationship is established, then what's the best way to create views on this kind of data. I'm almost convinced that it'd be easier just to write this stuff to an external database, but I'd like to give SharePoint a shot in order to take advantage of the automated search capabilities.

+2  A: 

Do it in a separate database, create a page(s) with controls that surfaces the data and run search over that. Loses quite a bit of the SharePoint features though.

Otherwise it may be okay to create a custom field control that will allow you to lookup the data in the other list. The custom field control can be the one to "view" the related data. I know we have done it for parent child relationships between pages on the same list. Not 1-to-N though.

Tough choice either way.

Nat
A: 

I do this a lot just using sharepoint, using a framework called AAA (Activity,Assignment,Artifact), which allows you to use lookup columns to link an assignment or artifact to a parent Activity. You then build a web part page with connected web parts that allow you to filter all assignments and artifacts by activity. For example, click next to a submission in the submission web part, and all of the submission items attached to that submission will show up. Works great.

Do you have a URL for that? I can't seem to find details on this framework.
Chris Farmer
Looks like this is the framework mentioned: http://www.endusersharepoint.com/?p=1147
Harv
+6  A: 

Proper Parent/Child in Sharepoint is near impossible without developing it yourself. There is one approach to that here: Simulate Parent / Child relationship in SharePoint 2007 with Folders & Content Types

Michael Stum
A: 

The other approach that you can look at using is persisting XML with a field in the item. This is the approach used by the Podcasting Kit (on CodePlex) to store things like ratings.

Daniel McPherson
A: 

One possible method is to create a submission content type based on the folder content type and a submission-item based on item content type. Then you can store data hierarchically like in file system and also will work default views and search functionality.

Other way is to create lookup field that points to same list (list=”self”). This field will be used like reference to parent item and you will get list that contains recursively related data. To use this data programmatically will be ok but using views functionality will be little bit complex.

EG
A: 

It's easy to do using a connected web part.

Create two lists:

Parent (Id, Title) Child (Id, Title, ParentId)

Create a new sharepoint page, add DataFormWebPart (displaying Parent) and another one for Child, set both of them to filter based on a QueryString parameter (use that Parameter to filter Parent.Id, and Child.ParentId) voila, you can display parent-child relationships. Now, adding children is more difficult, and that's the part I haven't worked out yet.

Andrew Lewis
+1  A: 

My vote is "to write this stuff to an external database"

You miss a lot of things in Sharepoint things like transaction support, referential integrity, easy way of updating (compare SQL), reporting (using Reporting Services and a SQL database)... see sharepoint as a way to store documents and simple lists.....

The argument for Sharepoint is if it is a small application, no requirements on support for transactions, no need to import external data etc...

When people say Sharepoint is a development plattform there is a need to define whjat they think a development plattform is.

The latest rumours about Sharepoint 2010 tells us that there will be support for SQL server based lists in next version ..... which I think will at least move Sharepoint in the right direction ....

salgo60
+1  A: 

Take a look at SLAM, SharePoint List Association Manager, an open source project my company created and actively supports. SLAM allows you to synchronize SharePoint data to SQL, including any relationships between lists. SLAM, in addition to being very useful on its own, is really a framework intended to allow developers to create their own complex data associations using what we call SLAM type profiles. We have one out-of-the-box type profile which is part of the open source project which actually allows you to make a SharePoint list hierarchical using the nested set model. For more information, see this page on our codeplex site.

A: 

One of of the ways how to implement master/detail functionality in SharePoint http://www.sharepointdrive.com/blog/Lists/Posts/Post.aspx?ID=6

Mindaugas Bliudzius
A: 
skyflyer