After recreating lookup column with same display name, column internal name in document library is different than site collection column name or column name in content type

Hi

Followed the below steps and observed that Column internal name in document library is different than Site column name or column name in content type

Part I) :  Create a new lookup column

1. Content type "Document" is already added to Document library.

2. Create a new Lookup list on Site collection say "ColorList"

3. Add entries in that list.

4. Go to Site Actions > Site Settings > Site content types > select Document content type.

5. Create a new lookup column name "LookupColor" based on "ColorList" list in site collection.(its internal column name is "LookupColor")

6. As  Content type is already added to document library the newly created column "LookupColor also added to document library with internal name ("LookupColor")

Part II) :  Delete the a earlier created lookup column

1. Go to Site Actions > Site Settings > Site content types

2. Select the "Document" content type, remove the earlier created "LookupColor" column from content type and its all derived content type.

3. Go to Site Actions > Site Settings > Site columns

4. Delete the earlier created "LookupColor" column from site collection.

5. When we go to document library and Library Settings > Columns still earlier created column is seen in document library its internal name "LookupColor"

Part II) :  Recreate the a new column lookup column  with same name

1. Go to Site Actions > Site Settings > Site content types > select Document content type.

2. Create a new lookup column name "LookupColor" based on "ColorList" list in site collection.(its internal column name is "LookupColor")

3. As  Content type is already added to document library the newly recreated column "LookupColor also added to document library which having  internal name as ("LookupColor0")

The column internal name present in the site collection and Document content type is "LookupColor", whereas the column name in document library is "LookupColor0. When we go to document library settings two column are shown in columns list one having internal name "LookupColor" and other having "LookupColor0". When we select the Document Content type from document library then "LookupColor0" is associated with "Document" content type. Which is different than one added to content type from site collection.

When I try to find "LookupColor0" column field by internal name using Web.Fields.GetField in site collection I am not able to get the field for same column.

August 18th, 2015 2:42am

Hello Gundage,

I followed your steps and when I called web.Fields.GetField('LookupColor0') method I received the following message:

Column 'LookupColor0' does not exist. It may have been deleted by another user

I verified it from Site Actions>>Site Setting >>Site Column (internal name is LookupColor not LookupColor0 )

It does not exist under site collection but it is still in the List. We need to get it from list.

Can you try modifying your code this way?

web.Lists["DocumentLibrary"].Fields.GetField("LookupColor0").Id

Thank you

Free Windows Admin Tool Kit Click here and download it now
August 19th, 2015 9:10pm

Thanks for reply.

The main issue is that, when I recreate the column and add same column in Content type its internal name is "LookupColor" where Lookup list is associated. The lookup list is not associated  "LookupColor0" column.

As I have added same column ("LookupColor" internal name ) in "Document" content type which in turns added in the document library. Then why column internal name differ in this case.

I dont have document library information with me so that I can query the field in list. 




August 21st, 2015 1:36am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics