You are here: Home » Custom URL Field Types

Custom URL Field Types

Posted by kal
No Comments »

Just a quick note on something that had me scratching my head for a couple of hours this afternoon. The task was to create a new custom field type that is based on the SPFieldUrl class. Although my fldtypes_*.xml file *looked* correct it wouldn't load. It turned out that the ParentType property value is both case-sensitive, and inconsistent. Whereas for a field that derives from SPFieldText you use set the property to "Text", if the parent type is an SPFieldUrl, you need to set the ParentType property to "URL" (all upper-case)!

So:

<FieldType>...<Field Name="ParentType">Url</Field>...</FieldType> is WRONG

<FieldType>...<Field Name="ParentType">URL</Field>...</FieldType> is RIGHT

 Gah!
 

Your email is never shared.
Required fields are marked *




Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>