Ask a questionAsk a question
 

Question'Required' field is not initialized correctly

  • Tuesday, November 03, 2009 2:15 AMDavidShen Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hi,

    i created a "List Definition" by using the VSeWSS 3 template, then i added a field for myself in the <Fields> element. the solution is build and deployed correctly. but after i create a list from that definition, i found my new field is not in the "create new" form, but in the list settings page, i can see my field and it is marked as *required*.

    what have i missed?
    BTW, the definition is created from the "Links" template.

    Thanks,
    David
    Regards, David Shen
    • Edited byMike Walsh MVPMVP, ModeratorTuesday, November 03, 2009 7:00 AMNo need to out the current product name in the Title. Especially if not exact ("[SharePoint 2007)")
    •  

All Replies

  • Tuesday, November 03, 2009 1:27 PMCharlie Holland Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Can you post the sections of xml from your schema.xml file where your field is defined?


    Ch. - My Blog
  • Tuesday, November 03, 2009 1:29 PMBrian Bedard Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You need to add a fieldref to your content type using that field's internal name.

    <ContentType ...>
    <FieldRef Name="fieldname" />
    </ContentType>
  • Wednesday, November 04, 2009 9:31 AMDavidShen Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    thx, i will try ;)
    Regards, David Shen
  • Thursday, November 05, 2009 2:44 AMDavidShen Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hi,

    here's my definition for my <Field> in the <Fields> element

          <Field ID="{B568CFAF-A8EF-43ac-9EB5-F17336BC8677}" Type="Text" Name="DevNote" DisplayName="Dev Note" Required="TRUE" Sealed="FALSE">
          </Field>

    Regards, David Shen
  • Thursday, November 05, 2009 2:46 AMDavidShen Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    hi,

    i added as you asked, now my <ContentTypes> element looks like this:
        <ContentTypes>
          <ContentTypeRef ID="0x0105">
            <Folder TargetName="Link"/>
          </ContentTypeRef>
          <ContentTypeRef ID="0x0120"/>
          <ContentType>
            <FieldRefs>
              <FieldRef Name="DevNote"/>
            </FieldRefs>
          </ContentType>
        </ContentTypes>
    
    but now, when i click on the list using this definition, i got a error saying that this action cannot be completed. did i missed anything?


    thx.

    Regards, David Shen
  • Thursday, November 05, 2009 7:00 AMDavidShen Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    ok, i figured out my problem, but i still cannot find a solution.

    Brian asked me to add a <ContentType> element, that is not i want. i do not want to create a content type in my list definition. i just want to add a field to it.

    when creating new columns on the web UI, i can check the 'add to all content types' check box, and then this new column will appear in all the 'create new' form of that list. so now, i just need to figured out how to add a new column and add it to all/specific content type by using the schema.xml file.

    thanks ;)
    Regards, David Shen