Dropdown/lookup column

Feb 25, 2010 at 8:10 AM
Edited Feb 25, 2010 at 9:58 AM

Hello,

This is the situation :

* List "color" :

ID | Title
1     Red
2     Blue
3     Black
6     Purple
7     White
9     Brown

* List "car"

ID | Title      | Colorid (lookup column to the ID column of "color" list
1     Ferrari        1              --> Red car
2     Porsche      3              --> a black porsch
5     BMW          7           
...

In my NewForm.aspx for adding a car :

Title      : [______]
Color id : [______][\/] Drop down the Id of the color
                     [  1]
                     [  2]
                     [  3]
                       ...

I would like to have :

Title            : [______]
Color name : [______][\/] Drop down the Id of the color
                     [    Red]
                     [   Blue]
                     [  Black]

Instead the Id display, I want the color name and the Id colord is save in the "colordid" in "car" list

Very complicated, isn't it ?

Perharps with your library, I can do that ??? I hope !! :-)

Thanks in advance !! :-)

A little remarks, if a change in the lookup column parameter in "car" list, the ID to the name of color, my AllItems.aspx is broken...

Coordinator
Feb 25, 2010 at 1:32 PM
You actually don't need anything more than out of box functionality
for this. Just change your Color lookup column to point to the Title
of the Color list rather than the ID.

M.
Mar 3, 2010 at 8:49 AM
Just change your Color lookup column to point to the Title
of the Color list rather than the ID.

I have done this but after there is a lot problem if you join these 2 lists in display.

The goal of my technique is to have something like a foreign key in my "car" list not a real "description".

Coordinator
Mar 3, 2010 at 1:51 PM

Lookup columns actually do stay in synch under the covers.  I understand your concern about having a valid foreign key.  In fact, SharePoint stores the ID of the lookup value in any case, like this: 1;#Red.  This is how it manages to keep the values in synch.

M.