SharePoint: Custom Field Type for MultiLine text

When you add a custom field type that can hold more than the 255 characters you can't use a field of type SPFieldText because it has a max length of 255 characters.

An obvious candidate is to use the field type SPFieldMultiLineText. No problems so far. But... in your custom version of the fldtypes.xml file (for example fldtypes_mytypes.xml) you have to define your parent type of the custom field. You would expect a parent type named MultiLineText, but no, that would be too obvious. It should be Note. Not documented, such a pity...

For example:

<?xml version="1.0" encoding="utf-8" ?>
<
FieldTypes>
    <
FieldType> <Field Name="TypeName">LongText</Field>
        <
Field Name="ParentType">Note</Field>
        <
Field Name="TypeDisplayName">Long Text</Field>
        <
Field Name="TypeShortDescription">Long Text</Field>
        <
Field Name="UserCreatable">TRUE</Field>
        <
Field Name="Sortable">FALSE</Field>
        <
Field Name="AllowBaseTypeRendering">TRUE</Field>
        <
Field Name="Filterable">FALSE</Field>
        <
Field Name="FieldTypeClass">...full qualified class,assembly name...</Field>
        <
PropertySchema>
            <
Fields></Fields>
        </
PropertySchema>
        <
RenderPattern Name="DisplayPattern">
            <
Column/>
        </
RenderPattern>
    </
FieldType>
</
FieldTypes>

A link with some more info (in Spannish): http://www.ideseg.com/SharePointDestripandoElWiki4.aspx

18 Comments

Comments have been disabled for this content.