locked
Help Joining SharePoint Lists RRS feed

  • Question

  • Hi Everyone,

     

    I am trying to create two lists: Products and Orders.  On my Products list view, I want a link to the Order's NewForm.aspx page where users can place an order for that product selected.  Any idea how I can accomplish this?

     

    I am using WSS 3.0

     

    Thank You

    -Sam Costa

    Friday, March 21, 2008 2:58 PM

Answers

  •  

    Please take a look at my blogpost: it describes how to accomplish your needs.
    Saturday, March 22, 2008 6:43 PM

All replies

  • just think about the ordering process from another perspective. The user chould click on the New Orders form and choose a product, instead of selecting a product and placing an order. to do this, create an Orders list with a lookup field that connects to the Products list.

    HTH

    Dean

     

    Saturday, March 22, 2008 11:00 AM
  • let's assume you have a product list Products and order list Orders with a required lookup-field to products:

     

    in SPD open your Products AllItems.aspx

    in code-view set <IsVisible>false</IsVisible> of the ListViewWebPart

    Menu Data View -> Insert Data View to add a DataFormWebPart to page

    If not visible Menu Task Panes -> Data Source Library

    Select Products DropDown -> Show Data

    Select fields to show in list from rows and !select ID (ctrl to select multiple fields)

    On top of rows select Insert selected fields as... -> Multiple Item View

    Customize your DataView with the WebParts Common Data View Task - Pane

    Switch to code-view and exchange the content of the ID table cell with

     

    Code Snippet
     <xsl:variable name="ProductID">
      <xsl:value-of select="@ID"/>
     </xsl:variable>
     <a href="../../Lists/Orders/NewForm.aspx?ProductID={$ProductID}">Order</a>

     

     

    With a little JavaScript in Orders/NewForm.aspx you than can set the selected option of the products lookup dropdown. The option value is the products list item id which came as url parameter.

     

    Greetings, Peter

     


     

     

     

     

    Saturday, March 22, 2008 3:27 PM
  •  

    Please take a look at my blogpost: it describes how to accomplish your needs.
    Saturday, March 22, 2008 6:43 PM