I have this script which creates a new site (SPWeb), which is based on a template.
I will the copy the data from the main list into the new list on the new site.
Both list is based on the same Contenttype.
SPList l = createWebsite.Lists["Sags Info"];
SPListItem li = l.Items.Add();
li["Title"] = properties.ListItem.Title; <-- WORKS FINE
li["LP_Postal"] = properties.ListItem["LP_Postal"]; <-- WORKS FINE
li["LP_Address"] = properties.ListItem["LP_Address"]; <-- WORKS FINE
li["LP_Sagstype"] = properties.ListItem["LP_Sagstype"]; <-- FAILS - Lookup field
li.Update();
How do i copy the lookup field over to the new list?
SPFieldLookup Sagstype = properties.ListItem["LP_Address"];
I have tried this, but that do not seems to work.