I need a choice field (in a site column) to reference a list I am importing into sharepoint. This list will very infrequently be updated to add additional choices. How would I create this column? Programmatically?
Well see it is a lookup per say… just trying to figure out how to code it… I'm assuming I need to import the list first as a new content type. Then create a lookup column (with multiple) for the content type?!?
Best Answer
Here's some code that will add a lookup field to an exsisting content type.
If your using list definitions then this is the only way a lookup field can be included. It can't be added into the CAML of the list definition because a guid for the lookup list is required and this is not known before hand. SharePoint autogenerates this Guid when the list is created.
So you need to first create the lookup column inside the root SPWeb of the SPSite
And then you'll need to add this field to the exsisting content type