Hi,
I have a list named "Projects" which has a number column named "Job Number",
I have attached an ItemAdded event handler to Job Number to increment.
Within the Projects list, I created a look up column named "Original Job" which looks up the value from the column Job Number.
When I click new item, I see the drop down values of all my Job numbers but when I choose one and click create item, there is no value, shows empty.
Here is my code:
SPList lookupList = currentSite.Lists["Projects"];
SPField lookupField = lookupList.Fields["Job Number"];
projectList.Fields.AddLookup("Original Job", lookupList.ID, false);
SPFieldLookup lookup = (SPFieldLookup)projectList.Fields["Original Job"];
lookup.LookupField = lookupField.InternalName;
lookup.Update();
Here is an image
http://pic100.picturetrail.com/VOL783/3746656/21927341/372654494.jpg
Can someone please explain why this occurs?