locked
SharePoint custom list design for related lists RRS feed

  • Question

  • Hi,

    We wanted to store parent-child related data using SharePoint custom lists. So there would be two lists, 1st list to store the parent records and 2nd list to store its child recrods.

    It is known that SharePoint list is not designed to be for RBDMS but I don't care about the forign key or RDBMS constraints here. So my question are as follows:

    1. Whether it is recommnded to store this kind information in SharePoint lists?
    2. How can I provide the user a single edit/new/display form to enter information into 2 lists. Can I do this with creating a custom form/web part?
    3. How can I make change to SharePoint search behaviour to show one record in search result for each parent-child records from 2 lists.

    Thanks in advance.
    San

    • Edited by Sanban Wednesday, September 9, 2009 5:27 PM removed extra characters
    Wednesday, September 9, 2009 5:22 PM

Answers

  • Hi,
        Here are my thoughts:

    1. You can store this kind of information using look up columns to create relationship between two lists. Many projects have this kind of requirements.
    2. Yes, you can do it using either custom web part or you can write event handler on the list for events like ItemAdding (for new) , ItemEditing (for edit). The code behind will read the data from the form and update any list.
    3. You can either use the SharePoint Search object model to query the list or you can write your own logic to search from the list and then the customized result you can show in a web part (Gridview).

    Ajit
    http://www.sharepointkings.com
    • Proposed as answer by Ajit Agashe Wednesday, September 16, 2009 8:42 AM
    • Marked as answer by Lily Wu Wednesday, September 16, 2009 8:43 AM
    Friday, September 11, 2009 6:33 AM

All replies

  • Hi,
        Here are my thoughts:

    1. You can store this kind of information using look up columns to create relationship between two lists. Many projects have this kind of requirements.
    2. Yes, you can do it using either custom web part or you can write event handler on the list for events like ItemAdding (for new) , ItemEditing (for edit). The code behind will read the data from the form and update any list.
    3. You can either use the SharePoint Search object model to query the list or you can write your own logic to search from the list and then the customized result you can show in a web part (Gridview).

    Ajit
    http://www.sharepointkings.com
    • Proposed as answer by Ajit Agashe Wednesday, September 16, 2009 8:42 AM
    • Marked as answer by Lily Wu Wednesday, September 16, 2009 8:43 AM
    Friday, September 11, 2009 6:33 AM
  • Hi

    Besides Ajit’s suggestion, I think custom SharePoint workflow can make it.
    When the item is edited or created, the custom workflow is automatically started with the same changes to be made to the other list.

    For how to create Office SharePoint Server 2007 workflows using Visual Studio 2008, please refer to:
    http://msdn.microsoft.com/en-us/library/cc936628.aspx
    For how to create a custom workflow using SharePoint designer, please refer to:
    http://office.microsoft.com/en-us/sharepointdesigner/HA101005911033.aspx

    In terms of one record to be show as search result, I think you can disable “Allow items from this list to appear in search results?” in SharePoint list setting -> Advanced settings for the child or parent list.
    In this case, only one record will be show in search result for each parent-child lists.

    Best Regards!

    Friday, September 11, 2009 8:57 AM
  • Thanks Ajit and Lily for your inputs ..

    Lily, I'm not very clear how workflow will be helpful for this. I think event handler or custom webpart would be ideal solution.
    Friday, September 11, 2009 5:30 PM