I have one site columns which is added to an existing Content Type that has been deployed via a Feature.
In the Content Type, the columns appear fine, but when viewing or editing the properties of a document which its list used the content type, the columns appear twice. They appear identical and updating one of the instances updates both instances. Looking at the available fields using PowerShell on the List Item and on the Site Collection does not show any duplication - the same is true when viewing the Library Settings and viewing the columns. Despite this, the duplication still happens when viewing or editing properties.
here is my code:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- My Column (Field)-->
<Field ID="{996A0BA7-4B25-44F9-9AE6-FBE47EC123CE}" Group="RK Fields" Name="Kategori" DisplayName="Kategori" Type="Text"
Hidden="TRUE" Required="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Kategori"/>
<!-- My Content Type -->
<ContentType ID="0x01010053e1d612ba3f4e21aa250ecd751942b3"
Name="RKDokument"
Group="RK Content Types"
Description="Innehållstyp för dokument på RK"
Inherits="TRUE"
Version="0">
<FieldRefs>
<FieldRef ID="{996A0BA7-4B25-44F9-9AE6-FBE47EC123CE}" Name="Kategori" />
</FieldRefs>
</ContentType>
</Elements>
Related
I'm trying sensenet features, my focus is on reference field inside content type.
I defined & installed the following content type successfully.
<?xml version="1.0" encoding="utf-8"?>
<ContentType name="EmployeeCT" parentType="GenericContent"handler="SenseNet.ContentRepository.GenericContent" xmlns="http://schemas.sensenet.com/SenseNet/ContentRepository/ContentTypeDefinition">
<DisplayName>Employee Record</DisplayName>
<Description></Description>
<Icon>Content</Icon>
<AllowIncrementalNaming>true</AllowIncrementalNaming>
<AllowedChildTypes>EmployeeCT</AllowedChildTypes>
<Fields>
<Field name="Manager" type="Reference">
<DisplayName>Manager</DisplayName>
<Description></Description>
<Configuration>
<AllowMultiple>false</AllowMultiple>
<AllowedTypes>
<Type>EmployeeCT</Type>
</AllowedTypes>
<SelectionRoot>
<Path>/Root</Path>
</SelectionRoot>
<!--<DefaultValue>/Root/Path1,/Root/Path2</DefaultValue>-->
<ReadOnly>false</ReadOnly>
<Compulsory>false</Compulsory>
<VisibleBrowse>Show</VisibleBrowse>
<VisibleEdit>Show</VisibleEdit>
<VisibleNew>Show</VisibleNew>
</Configuration>
</Field>
</Fields>
</ContentType>
The problem is that I could not found & pick manager of employee.
Any help please,
Thanks.
Are there any previously saved content with the type EmployeeCT? Because you set it as the only allowed type as the value of the Manager field.
I've checked your code on my local site and it works. First I had to save an Employee Record to create a content for a manager and then I was able to pick it as a manager of a new Employee Record.
I'm using SSRS for generating reports, have created the data source and dataset, and I'm able to retrieve the data. However, some items which are inside the folder are not getting displayed in report.
It's not fetching items inside a report.
Dont know how to mention scope here for query. Below is my query:
<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ListName>Program</ListName>
<ViewFields>
<FieldRef Name="Title" />
<FieldRef Name="Requestor" />
</ViewFields>
</RSSharePointList>
I have a problem that i've struggled with for a long time. This problem manifests itself in the test environment, but not in my dev environment.
I have a document library template. In a event handler I attach several content types (which all inherit from a base content type which in turn inherits from Document). The base content type has a custom document template, and event handlers defined in xmldocuments on the contenttype definition.
The Doc-ID feature is switched on in the site.
When uploading a file to the document library, the document is assigned a document ID as expected. When saving a file from Word however, the doc-ID is blank. Apparently the value is set on the item, because when changing the content type of the item afterwards, the doc-ID appears with a number indicating that it was assigned when the file was first saved. When setting the contenttype back to the original value, the Doc-ID remains displayed in the view.
To clarify: This is not the ID field of the Item content type, but the Doc-ID that is created by the doc-ID feature in SharePoint 2010.
Any ideas to why this value is not set when promoting values from Word?
It seems that the solution lied in the base Document content type in the site collection. When the document-id feature is activated, event handlers are added to the content type definition as xmldocuments. When a regular document library is created, the content type in the library inherits from this content type, and thus gets a copy of the event receivers.
My custom document library with custom content types did not inherit from the site collection document content type, but rather from the base document content type (0x0101), and did not get a copy of the event receivers.
Copying the xmldocuments into my base content type seems to do the trick.
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
<spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
<Receiver>
<Name>Document ID Generator</Name>
<Synchronization>Synchronous</Synchronization>
<Type>10001</Type>
<SequenceNumber>1000</SequenceNumber>
<Assembly>Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<Class>Microsoft.Office.DocumentManagement.Internal.DocIdHandler</Class>
<Data>
</Data>
<Filter>
</Filter>
</Receiver>
<Receiver>
<Name>Document ID Generator</Name>
<Synchronization>Synchronous</Synchronization>
<Type>10002</Type>
<SequenceNumber>1001</SequenceNumber>
<Assembly>Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<Class>Microsoft.Office.DocumentManagement.Internal.DocIdHandler</Class>
<Data>
</Data>
<Filter>
</Filter>
</Receiver>
<Receiver>
<Name>Document ID Generator</Name>
<Synchronization>Synchronous</Synchronization>
<Type>10004</Type>
<SequenceNumber>1002</SequenceNumber>
<Assembly>Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<Class>Microsoft.Office.DocumentManagement.Internal.DocIdHandler</Class>
<Data>
</Data>
<Filter>
</Filter>
</Receiver>
<Receiver>
<Name>Document ID Generator</Name>
<Synchronization>Synchronous</Synchronization>
<Type>10006</Type>
<SequenceNumber>1003</SequenceNumber>
<Assembly>Microsoft.Office.DocumentManagement, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<Class>Microsoft.Office.DocumentManagement.Internal.DocIdHandler</Class>
<Data>
</Data>
<Filter>
</Filter>
</Receiver>
</spe:Receivers>
</XmlDocument>
</XmlDocuments>
I have a SP project with two features:
a first feature that defines some fields, a content type and a list definition
a second feature that defines a list instance of the first feature definition
in the second feature, I use the ContentTypeRef element to bind to the content type defined in the first feature. I saw in many blog post and forum thread that Fields are not correctly populated to the list, but it's not my issue (maybe it's related ?)
The instantiated list defines a content type, but instead of inheriting from my content type, it inherits the "System" content type.
Is this behavior correct ? how can I actually inherits my content type instead of system content type ?
thx in advance
[Edit] the simpliest workaround I found is to copy past the content type definition into the contenttypes element of my list schema... but it's still a copy/paste operation (as ugly as it can be)
Please make sure that your content type ID is valid, I never managed to bypass the item content type (0x01) which means that your content type will have an ID of 0x0100{A-GUID}.
Anyway, even if you defined properly your content type and this one is working as expected when you bind it to a custom list, you'll still need to re-declare it in your list schema with all its field reference and once again, copy most of the definition of your field (I had issue with less than ID, name, display name, type in this area)...
Eg with the last list I created :
<ContentTypes>
<ContentType ID="0x0100FDCCBFFB0FBF4D5C8E069F582412909602" Name="UniverseTranslation" Group="XYZ" Description="Universe Translation" Version="0">
<FieldRefs>
<FieldRef ID="{39BF387B-C20A-4D30-BD17-CB70E4609FA2}" Name="LookupUniverse" DisplayName="Universe" Required="TRUE" />
<FieldRef ID="{824F7063-6D09-48CD-B5BA-FE9B5EE36D6A}" Name="WCC_Language" DisplayName="Language" Required="TRUE" />
<FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="Translation" Required="TRUE" />
<FieldRef ID="{EC8E4DB7-B715-430B-9B4A-F222F025EFAB}" Name="RichDescription" DisplayName="Description"/>
</FieldRefs>
</ContentType>
</ContentTypes>
<Fields>
<Field
ID="{39bf387b-c20a-4d30-bd17-cb70e4609fa2}"
Name="LookupUniverse"
DisplayName="Universe"
Type="Lookup"
ShowField="Title"
Required="TRUE"
EnforceUniqueValues="FALSE"
List="Lists/Universes">
</Field>
<Field
ID="{824F7063-6D09-48CD-B5BA-FE9B5EE36D6A}"
Name="WCC_Language"
DisplayName="Language"
Type="VariationLabelsFieldType"
Required="TRUE">
</Field>
<Field
ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}"
Name="Title"
DisplayName="Translation"
Type="Text"
Required="TRUE">
</Field>
<Field
ID="{EC8E4DB7-B715-430B-9B4A-F222F025EFAB}"
Name="RichDescription"
DisplayName="Rich Description"
Type="Note"
NumLines="4"
RichText="TRUE"
RichTextMode="Compatible"
AllowHyperlink="TRUE"
IsolateStyles="FALSE"
AppendOnly="FALSE"
Required="FALSE">
</Field>
</Fields>
If you can post your content type definition and part of your list schema, I'm pretty sure we'll be able to provide a more relevant help.
Kindly
It worked for me by adding the relative folder path for the content type's resource folder. It also worked for adding multiple references for content types to the list as follows:
<ContentTypes>
<ContentType ID="0x01006775E96C04A04F52AC1FCE50F0CB0901" Name="contentType1" Group="Test Content Types" Description="Test Content Type" Inherits="TRUE" Version="0">
<Folder TargetName="contentType1" />
</ContentType>
<ContentType ID="0x0100958BB07B626A494F9201B03E96948F3D" Name="contentType2" Group="Test Content Types" Description="Test Content Type" Inherits="TRUE" Version="0">
<Folder TargetName="contentType2" />
</ContentType>
</ContentTypes>
I am adding a new field to a list using the AddFieldAsXML method of SPFieldCollection. The method executes fine with no problem. And the column header shows up when I view the list; however the value never displays in the column. Here is what the field looks like after it has been added to the list. This xml is a snipped from the list schema derived using http://tw-s1-m4400-007:4016/_vti_bin/owssvr.dll?Cmd=ExportList&List={1F87433F-50E1-46C5-A138-00E1CF7E5801}
This code works great in 2007 but does not work in 2010. Any help would be appreciated.
<Field ID="{e24ccb96-35fd-44e5-b7d1-4150dbbc9a64}" Type="Computed" ReadOnly="TRUE"
Name="My_x0020_Status" DisplayName="MyStatus" ShowInEditForm="TRUE" ClassInfo="Icon"
AuthoringInfo="(My status)" SourceID="http://schemas.microsoft.com/sharepoint/v3"
StaticName="MyStatus" FromBaseType="TRUE">
<FieldRefs>
<FieldRef Name="ID" />
<FieldRef Name="Title" />
</FieldRefs>
<DisplayPattern>
<HTML>
<![CDATA[ <a href="form.htm?ID="
]]>
</HTML>
<Column Name="ID" />
<HTML>
<![CDATA[ ">
]]>
</HTML>
<Column Name="Title" />
<HTML>
<![CDATA[ </a>
]]>
</HTML>
</DisplayPattern>
</Field>
This link provided a lot of help in solving this issue:
http://social.technet.microsoft.com/Forums/en/sharepoint2010customization/thread/ef0d1d22-47ff-416c-becd-13d48de80e4d
Basically, display patterns fields are defined in the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\XSL\fldtypes.xsl file.
There is a file called fldtypes_ratings.xsl that you can use as an example of defining your custom field display.
You can create your own xsl file (i.e. fldtypes_myfile.xsl) to define your own custom display.
Here's a sample of my content:
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema"
xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-
prefixes="xsl msxsl ddwrt" ns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:template match="FieldRef[#Name='MyCustomField']" mode="Computed_body">
<xsl:param name="thisNode" select="."/>
<SPAN class="mystuff-content-item" style="Width:100%;text-align:center">
<SPAN class='mystuff-socialized-status mystuff-socialized-status-unknown'></SPAN>
<SPAN class="mystuff-content-object-type" style="display:none">
MyContent
</SPAN>
<SPAN class="mystuff-content-followed" style="display:none">0</SPAN>
<SPAN class="mystuff-content-name" style="display:none"></SPAN>
<SPAN class="mystuff-content-id" style="display:none">
<xsl:value-of select="$List" />
<xsl:text>|</xsl:text>
<xsl:value-of select="$thisNode/#ID" />
</SPAN>
</SPAN>
</xsl:template>
</xsl:stylesheet>
Hope that helps!
I'm confused as to the point of referencing these articles -- both of them state "Two legacy field types that ship with SharePoint Foundation do not have a DisplayPattern type of RenderPattern in FLDTYPES.XML: (1) ContentTypeId fields are never visible. (2) Computed fields are rendered on list views and in Display mode by a DisplayPattern element in their Field elements within the schema.xml of each list on which they appear."
The original question is clearly defined as a "Computed" field, that according to the linked articles do not use the fldttypes.xml for their renderpattern, but intstead use the DisplayPattern element just as the original question posted. It would help to post references to how the DisplayPattern works in 2010 -- since the documentation clearly states that it Does work, but never says how.
See my blog on this here: http://www.threewill.com/2012/07/computed-fields-in-sp-2010/. Hopefully this makes it clear on how to do computed fields in SP2010.
This method of customization from 2007 is made obselete by changes in 2010's rendering of fields. Read the note from the SDK entry on RenderPattern for more detail:
Important!
This topic describes markup that was used in a now obsolete method of rendering custom fields types on list views and on the Display, Edit, and New forms. It is provided solely to assist persons who are debugging a custom field type that was originally developed against an earlier version of SharePoint Foundation. For information about the recommended methods, see How to: Create Field Rendering Templates and How to: Create a Custom Field Type.
Custom fields whose rendering is defined with RenderPattern markup still render properly on forms. However, SharePoint Foundation, by default, uses XSLT stylesheets to render fields on list views, even for legacy custom fields whose list view rendering is defined with a RenderPattern. To enable the rendering of such a field, a TRUE element must be added to the containing FieldTypes element in the field type definition file (fldtype*.xml).