Hi there,
I've got a huge problem. I want to use two custom Content Types (declared by XML). Both got a custom column (decalred by XML).
The column looks like this:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"><Field ID="{3A4F54E4-4579-4E19-B9C2-9F02A180CCBB}"
Name="Requirements"
Type="LookupMulti"
Required="FALSE"
Group="Fields_GroupName"
Description="Field_Requirements_Description"
DisplayName="Field_Requirements_DisplayName"
Title="Field_Requirements_Title"
List="Lists/OtherList"
ShowField="Title"
Mult="TRUE"/></Elements>The first content type is working fine. It is used in a list template. It looks like this:
<ContentType ID="0x0100A731269F3817405CBA0F0514BED6E2F9"
Name="CT_Title"
Group="CT_GroupName"
Description="CT_Description"
Inherits="TRUE"
Version="0"><FieldRefs><FieldRef ID="{3A4F54E4-4579-4E19-B9C2-9F02A180CCBB}" Name="Requirements" Required="TRUE"/></FieldRefs></ContentType>The second one does not work with this specific field and I don't know why.
<ContentType ID="0x01008C72CFC08C7548FFA872708540EA05C1"
Name="CT_Title2"
Group="CT_GroupName"
Description="CT_Description2"
Inherits="TRUE"
Version="0"><FieldRefs><FieldRef ID="{64cd368d-2f95-4bfc-a1f9-8d4324ecb007}" Name="StartDate" Required="TRUE"/><FieldRef ID="{2684f9f2-54be-429f-ba06-76754fc056bf}" Name="EndDate" Required="TRUE"/><FieldRef ID="{288f5f32-8462-4175-8f09-dd7ba29359a9}" Name="Location"/><FieldRef ID="{3A4F54E4-4579-4E19-B9C2-9F02A180CCBB}" Name="Requirements" DisplayName="Test" Required="FALSE"/><FieldRef ID="{89B66BCA-91DF-4EC9-9E2C-A3A00EBC9AD5}" Name="TestEnabled" Required="TRUE"/><FieldRef ID="{9FE6C121-198B-4812-A446-F9BB54083BE6}" Name="CNumber"/><FieldRef ID="{9da97a8a-1da5-4a77-98d3-4bc10456e700}" Name="Comments"/></FieldRefs></ContentType>Without the column it works fine.
The following error occurs:
<nativehr>0x80070057</nativehr><nativestack></nativestack>
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: <nativehr>0x80070057</nativehr><nativestack></nativestack>
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: <nativehr>0x80070057</nativehr><nativestack></nativestack>]
Microsoft.SharePoint.Library.SPRequestInternalClass.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd) +0
Microsoft.SharePoint.Library.SPRequest.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd) +153
Microsoft.SharePoint.SPFieldCollection.AddFieldAsXmlInternal(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op, Boolean isMigration, Boolean fResetCTCol) +449
Microsoft.SharePoint.SPContentType.ProvisionFieldOnList(SPField field, Boolean bRecurAllowed) +1547
Microsoft.SharePoint.SPContentType.ProvisionFieldsOnList() +634
Microsoft.SharePoint.SPContentType.DeriveContentType(SPContentTypeCollection cts, SPContentType& ctNew) +682
Microsoft.SharePoint.SPContentTypeCollection.AddContentTypeToList(SPContentType contentType) +2319
Microsoft.SharePoint.SPContentTypeCollection.AddContentType(SPContentType contentType, Boolean updateResourceFileProperty, Boolean checkName, Boolean setNextChildByte) +242
Microsoft.SharePoint.SPContentTypeCollection.Add(SPContentType contentType) +24
Microsoft.SharePoint.ApplicationPages.AddContentTypeToListPage.Update(Object o, EventArgs e) +835
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981