Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SharePoint > SharePoint Development
|
SharePoint Development Programming and development for SharePoint Portal Server and Windows SharePoint Services
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SharePoint Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 12th, 2010, 02:28 AM
Authorized User
 
Join Date: Feb 2006
Posts: 63
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Hannibal
Default Help with Custom List Definition

Hi,

I am trying to create a custom list definition, as I want 4 columns to be shown at New form and show 7 columns during Edit form.

I had created a Feature.xml, Elements.xml. Created a sub folder and inside that added Schema.xml.

In the Schema.xml, i have the below code:
Code:
<?xml version="1.0" encoding="utf-8" ?> 
<Fields>
     <Field ID="{guid}" 
                                                Name="Title" 
                                                DisplayName="Title" 
                                                Required="TRUE" 
                                                ShowInNewForm="TRUE" 
                                                ShowInEditForm="TRUE"/>
     <Field ID="{guid}"              
                                                Name="Description"              
                                                Type="Note"              
                                                DisplayName="Description"              
                                                SourceID="http://schemas.microsoft.com/sharepoint/v3/fields"              
                                                StaticName="Description"              
                                                Description="Enter a brief description of the request."              
                                                RichText="TRUE"
                                                RichTextMode ="FullHTML"
                                                NumLines="6"
                                                Sortable="FALSE"
                                                Sealed="TRUE"              
                                                Required="TRUE"              
                                                AllowDeletion="FALSE">
      
      ShowInNewForm="TRUE" 
                                                ShowInEditForm="TRUE"
                                                <Default></Default>
                                </Field>
    <Field ID="{guid}"              
                                                Name="Services Offered"              
                                                Type="Choice"              
                                                DisplayName="Services Offered"              
                                                SourceID="http://schemas.microsoft.com/sharepoint/v3/fields"              
                                                StaticName="ServicesOffered"              
                                                Description="Select the required service."  
                                                Sortable="TRUE" 
                                                Sealed="TRUE"              
                                                Required="TRUE"              
                                                AllowDeletion="FALSE"              
                                                FillInChoice="FALSE">
                                                <CHOICES>
                                                                <CHOICE>Creation</CHOICE>
                                                                <CHOICE>Access Request</CHOICE>
               <CHOICE>Other Request(s)</CHOICE>
                                                               
                                                </CHOICES>
      
      ShowInNewForm="TRUE" 
                                  ShowInEditForm="TRUE"
                                                <Default>Creation</Default>
                                </Field>

      <Field ID="{guid}"              
                                                Name="Priority"              
                                                Type="Choice"              
                                                DisplayName="Priority"              
                                                SourceID="http://schemas.microsoft.com/sharepoint/v3/fields"              
                                                StaticName="Priority"              
                                                Description="Select the Priority."  
                                                Sortable="TRUE" 
                                                Sealed="TRUE"              
                                                Required="TRUE"              
                                                AllowDeletion="FALSE"              
                                                FillInChoice="FALSE">
                                                <CHOICES>
                                                                <CHOICE>(1) High</CHOICE>
                                                                <CHOICE>(2) Normal</CHOICE>
                                                                <CHOICE>(3) Low</CHOICE>                                                               
                                                </CHOICES>
      
      ShowInNewForm="TRUE" 
                                  ShowInEditForm="TRUE"
                                                <Default>(2) Normal</Default>
                                </Field>
 <Field ID="{guid}"              
                                                Name="Start Date"              
                                                Type="DateTime"              
                                                DisplayName="Start Date"              
                                                SourceID="http://schemas.microsoft.com/sharepoint/v3/fields"              
                                                StaticName="StartDate"              
                                                Description=""
                                                Sortable="TRUE" 
                                                Sealed="TRUE"              
                                                Required="FALSE"
                                                StorageTZ="UTC"
                                                AllowDeletion="FALSE"              
                                                FillInChoice="FALSE">
      
      ShowInNewForm="FALSE" 
                                  ShowInEditForm="TRUE"
                                                <Default></Default>
                                </Field>
    <Field ID="{guid}"              
                                                Name="End Date"              
                                                Type="DateTime"              
                                                DisplayName="End Date"              
                                                SourceID="http://schemas.microsoft.com/sharepoint/v3/fields"              
                                                StaticName="EndDate"              
                                                Description=""
                                                Sortable="TRUE" 
                                                Sealed="TRUE"              
                                                Required="FALSE"
                                                StorageTZ="UTC"
                                                AllowDeletion="FALSE"              
                                                FillInChoice="FALSE">
      ShowInNewForm="FALSE" 
                                  ShowInEditForm="TRUE"
                                                <Default></Default>
                                </Field>
 <Field ID="{guid}"              
                                                Name="Status"              
                                                Type="Choice"              
                                                DisplayName="Status"              
                                                SourceID="http://schemas.microsoft.com/sharepoint/v3/fields"              
                                                StaticName="Status"              
                                                Description=""  
                                                Sortable="TRUE" 
                                                Sealed="TRUE"              
                                                Required="TRUE"              
                                                AllowDeletion="FALSE"              
                                                FillInChoice="FALSE">
                                                <CHOICES>
                                                                <CHOICE>Completed</CHOICE>
                                                                <CHOICE>Pending</CHOICE>
                                                                <CHOICE>In Progress</CHOICE>                                                               
                                                </CHOICES>
      
      ShowInNewForm="FALSE" 
                                  ShowInEditForm="TRUE"
                                                <Default></Default>
            
     <Field ID="{guid}" 
                                                Name="Assigned To" 
                                                DisplayName="Assigned To" 
                                                Required="FALSE" 
                                                ShowInNewForm="FALSE" 
                                                ShowInEditForm="TRUE"/>
                                </Field>
</Fields>
<ViewFields>
                                  <FieldRef Name="Title" />
                                  <FieldRef Name="Description" />
                                  <FieldRef Name="Services Offered" />
                                  <FieldRef Name="Priority" />
        </ViewFields>
I had deployed the features. I tried to create a list with the template, I am getting the below error:

"Cannot complete this action.

Please try again. at Microsoft.SharePoint.Library.SPRequestInternalClas s.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl)
at Microsoft.SharePoint.Library.SPRequest.CreateListF romFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl) "

Is there anything wrong with the schema.xml.

Please help.

Thank you





Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Custom Site Definition pragaw BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 13 June 19th, 2009 11:22 AM
create a custom list to store the category code kiwibey SharePoint Development 0 April 3rd, 2008 02:04 AM
Generic List Serialisation with custom property rodmcleay C# 2005 1 April 23rd, 2007 12:52 PM
get list of custom procedures a_southwould Pro VB 6 0 May 13th, 2004 02:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.