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

Published Tuesday, September 18, 2007 2:42 PM by svdoever
Filed under:

Comments

Tuesday, September 18, 2007 8:58 PM by Links (9/18/2007) « Steve Pietrek’s SharePoint Stuff

# Links (9/18/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

Pingback from  Links (9/18/2007) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

Wednesday, September 19, 2007 5:03 AM by Emmanuel Desigaud

# re: SharePoint: Custom Field Type for MultiLine text

Hello,

I was facing the issue of the 255 characters limitation and now, it's gone :)

Thanks for the tips !

Emmanuel

Wednesday, October 17, 2007 1:12 AM by Matthew petersen

# re: SharePoint: Custom Field Type for MultiLine text

Serge,

Do you know the 'parenttype' values for the other field types? I have been looking everywhere for a definitive list and cannot find one anywhere. Also, is it possible to create your own custom field type from a custom control instead of a standard sharepoint control?

thanks

Matt

Friday, October 26, 2007 5:25 AM by red_c

# re: SharePoint: Custom Field Type for MultiLine text

hi,

i'm red_c and my proglem is:

"...full qualified class,assembly name"

What's this line. I serched in all internet, and don't understend this.

pleas somebody help my... this is importand for me

Friday, December 21, 2007 8:37 AM by charlie

# re: SharePoint: Custom Field Type for MultiLine text

I'm not seeing the complete picture. I can get my control to be a multiline control, but it still only stores 255 characters in the sharepoint database.

What class do I derive my field from?

SPFieldMultiLineText doesn't fix the 255 problem. SPField doesn't solve the 255 problem either.

Thursday, May 15, 2008 2:19 AM by paul

# re: SharePoint: Custom Field Type for MultiLine text

Hi Serge,

I am having the same problem as Charlie it is multiline but only takes 255 characters.

Am i missing something?

Wednesday, June 11, 2008 12:58 PM by Sam

# re: SharePoint: Custom Field Type for MultiLine text

Did Serge and Charlie happen to solve the 255 character limitation? I'm chasing my tail here also.

Monday, June 23, 2008 7:34 AM by Scott

# re: SharePoint: Custom Field Type for MultiLine text

Guys, you need to define it as a Note Type. e.g

<Field

ID="{}"

Type="Note"

Name="$Resources:names,fred;"

DisplayName="$Resources:names,fred;"

StaticName="$Resources:names,fred;"

Hidden="FALSE"

Required="FALSE"

Sealed="TRUE"

AllowDeletion="FALSE"

/>

Friday, October 03, 2008 5:58 PM by kjk

# re: SharePoint: Custom Field Type for MultiLine text

this does not work.

Friday, October 03, 2008 6:27 PM by kjk

# re: SharePoint: Custom Field Type for MultiLine text

this does not work.

Monday, October 20, 2008 12:56 AM by arunsingh

# re: SharePoint: Custom Field Type for MultiLine text

I did all short of this but invain.

Did field type as as SPMultiLineText...

in XML, parent type is Note

finally SPField type is NoteField....

But still not able to resolve the issue.

Plz suggeest along with this what we have to do.

Thanx in advance,

arun

Thursday, November 13, 2008 5:05 AM by ALex

# re: SharePoint: Custom Field Type for MultiLine text

Hi,

I tried this, however the field still show only 255 characters.

But the Error message is hopefully gone.

Alex

Tuesday, December 16, 2008 1:51 PM by Bala

# re: SharePoint: Custom Field Type for MultiLine text

I am not able to edit any custom fields in MS Word. I can only edit in the SharePoint environment. IS there any way I can edit those fields in MS Word?

Thursday, May 21, 2009 12:42 PM by Senthil

# re: SharePoint: Custom Field Type for MultiLine text

A simple workaround for the issue using Object model

# Inconvenient Content Query Web Part vs. Lookup fields with multiple values - Waldek Mastykarz

Pingback from  Inconvenient Content Query Web Part vs. Lookup fields with multiple values - Waldek Mastykarz

Thursday, July 23, 2009 9:47 AM by jonkman

# re: SharePoint: Custom Field Type for MultiLine text

A bit late maybe, but if someone finds this thread (like me) and wonders what the answer to the 255 chars problem is:

When converting a column from SPFieldText to SPFieldMultiLineText the column does not properly reflect the changes made in the code and in the XML. E.g. it is still not able to store more than 255 characters.

But I created a new DocLib, added my supposed not working custom column, and voilá: it suddenly worked and hold all the content.

Additionally I added a new Field property:

<Field Name="SQLType">ntext</Field>

into the XML definition like suggested by

panvega.wordpress.com/.../field-types

Thursday, November 12, 2009 7:36 AM by Jimmy Thomsen

# re: SharePoint: Custom Field Type for MultiLine text

Hi.

This is actually described on MSDN:

msdn.microsoft.com/.../ms437580.aspx

For note:

Allows users to enter multiple lines of text. This field is not sortable or groupable. All text is defined to be straight ASCII characters without HTML markup. Anything that looks like HTML markup or a URL is simply quoted (for example, Server.HTMLEncode) to look like straight text. The control for editing this format is a simple TEXTAREA block. Use the NumLines attribute to specify the number of lines to display. Corresponds to the ntext SQL data type and represented by the SPFieldMultiLineText class.

For text:

Text   A single line of text entered in an edit box. This field is sortable and groupable. Use the MaxLength attribute to set a maximum number of characters allowed. Corresponds to the nvarchar SQL data type and represented by the SPFieldText class.

Now lookup the limits for ntext and nvarchar.

Sunday, May 02, 2010 11:45 PM by Robert Sandoval

# re: SharePoint: Custom Field Type for MultiLine text

Greetings to anyone who may still be subscribed to this post.  

Has anyone ever had to change a Multiple-line of text to single-line of text in SharePoint 2003?  

Saturday, December 04, 2010 2:03 AM by skateboard artwork

# re: SharePoint: Custom Field Type for MultiLine text

"I happen to be reading your entries throughout my afternoon bust, and i have to admit the entire article has been quite enlightening and quite well composed. I thought I'd allow you to know that for some cause this blog doesn't display well in Web Explorer 8. I wish Microsoft would stop altering their software program. I've a question for you personally. Do you mind exchanging blog site roll hyperlinks? That would be seriously cool! "

--------------------------------------------

my website is <a href="zeroskateboards.org/.../polystyrene-skateboards.html">zero skateboards logo</a> .Also welcome you!

Monday, December 06, 2010 10:27 AM by Weber Grills

# re: SharePoint: Custom Field Type for MultiLine text

VRy intriguing to study it :P

--------------------------------------------

my website is  

http://hohnerharmonica.org

Also welcome you!

Saturday, December 18, 2010 4:51 AM by good reader ipad app

# re: SharePoint: Custom Field Type for MultiLine text

Good is good, but better carries it.

-----------------------------------

Sunday, January 02, 2011 6:30 PM by ipad stand

# re: SharePoint: Custom Field Type for MultiLine text

-----------------------------------------------------------

"Dental packages in Costa Rica include all costs like X-ray, prosthesis, and so on., on the clinic, as well as the dentist's costs, and however they're 50-70% less expensive than anything you  will locate within the US, UK, Canada."

Friday, January 07, 2011 7:14 PM by ipad app

# re: SharePoint: Custom Field Type for MultiLine text

-----------------------------------------------------------

"Hey - awesome website. Just checking out some blogs, appears a pretty great system you happen to be making use of. I am currently employing Wordpress for a few my weblogs but I'm not happy with it so considerably. I am looking to alter a single of them over to a platform equivalent to yours (BlogEngine) as a trial run. Anything in particular you'd suggest about it?"

Friday, July 01, 2011 8:39 PM by George Emmitt

# re: SharePoint: Custom Field Type for MultiLine text

The very heart of your writing while appearing reasonable originally, did not settle correctly with me personally immediately after some time. Someplace throughout the sentences you actually managed to create me a believer but only for a short while. I nevertheless have got a issue together with your leaps in logic and you may do nicely to fill in those breaks. For those who in fact can accomplish that, I could surely be fascinated.

Tuesday, July 05, 2011 2:08 PM by Alvaro Garratt

# re: SharePoint: Custom Field Type for MultiLine text

Hey there! Quick question that's completely off topic. Do you know how to make your web site mobile friendly? My web-site looks weird when viewing from my iphone. I'm attempting to find a template or plugin that may well have the ability to fix this issue. When you have any suggestions, please share. With thanks!

Friday, August 26, 2011 8:20 PM by tryecrot

# re: SharePoint: Custom Field Type for MultiLine text

Yes there should realize the opportunity to RSS commentary, quite simply, CMS is another on the blog.

Wednesday, February 01, 2012 9:29 PM by Twinnidgict

# re: SharePoint: Custom Field Type for MultiLine text

A Lovely dripable Alternative

Monday, November 26, 2012 1:46 AM by -

# re: SharePoint: Custom Field Type for MultiLine text

<a href="http://www.spywareremovaltoolkit.com">Spyware Removal</a>A_B_C_NX

Sunday, December 16, 2012 3:58 PM by -

# re: SharePoint: Custom Field Type for MultiLine text

<a href="http://www.spywareremovaltoolkit.com">Spyware Removal</a>A_B_C_NX

Leave a Comment

(required) 
(required) 
(optional)
(required)