Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a content type that references a built-in site column like this:

<Elements ...>
    <ContentType ...>
        <FieldRefs>
            <!-- a reference to the built-in field called "Email2" -->
            <FieldRef ID="{e232d6c8-9f49-4be2-bb28-b90570bcf167}"
                      Name="EmailUrgent"
                      DisplayName="Urgent Email"/>
            <!-- other fields -->
        </FieldRefs>
    </ContentType>
</Elements>

This content type will deploy just fine. In visual studio, I created a list template and instance from this content type. Here is the first part of the Schema.xml:

<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="Station List" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/MyContentTypeName" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
  <MetaData>
    <ContentTypes>
      <ContentType ID="0x01009e5b439643e048d6a83e8431f4322f0500e0e09a4c1ccb443f97a9dc228fe0b9f8" Name="MyContentTypeName" Group="MyGroup" Description="" Inherits="TRUE" Version="0">
        <FieldRefs>       
                  <!-- other fieldrefs -->
          <FieldRef ID="{e232d6c8-9f49-4be2-bb28-b90570bcf167}" Name="EmailUrgent" DisplayName="Urgent Email" />
        </FieldRefs>
      </ContentType>
    </ContentTypes>
    <Fields>      
      <Field ID="{E232D6C8-9F49-4be2-BB28-B90570BCF167}" Name="Email2" StaticName="Email2" SourceID="http://schemas.microsoft.com/sharepoint/v3" DisplayName="$Resources:core,E-mail_2_OL;" Group="$Resources:core,Person_Event_Columns;" Type="Text" Sealed="TRUE" AllowDeletion="TRUE" />
      <!-- other fields -->
    </Fields>
        <Views>
           <!-- blah blah -->
        </Views>
        <Forms>
           <!-- blah blah -->
        </Forms>
    </MetaData>
</List>

And finally, the list instance xml:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="MyContentType"
                OnQuickLaunch="TRUE"
                TemplateType="10001"
                Url="Lists/MyContentTypeName"
                Description="My List Instance">
      <Data>
          <Rows>
              <Row>
                  <Field Name="EmailUrgent">urgent@none.com</Field>
                  <!-- other fields -->
              </Row>
                  </Rows>
          </Data>
    </ListInstance>
</Elements>

It's the list instance that causes a problem, ending ultimately in an error like this:

Error occurred in deployment step 'Activate Features': Column 'EmailUrgent' does not exist. It may have been deleted by another user.

The only thing I see that seems questionable is that I try to change the internal names of the fields in the content type definition. Is that where I'm going wrong, or is it somewhere else?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

AFAIK you cannot change internal name once the site column is created. The name must be same as internal name which is guaranteed to be unique once a site column is created.

share|improve this answer
    
I think you're right. I changed the internal name in the content type and re-generated the list template and it seems to work. I'm still having problems with the list instance, but that's a separate issue. –  Ben Collins Nov 15 '11 at 16:19
    
thanks. you may create a separate issue related to list instance that you are facing. –  Ashish Patel Nov 15 '11 at 16:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.