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