I'm trying to create a custom field type in SharePoint 2007, and the steps I did as below:
i) Create a Class Library project in Visual Studio. The code:
public class CustomField : SPFieldText
{
public CustomField(SPFieldCollection fields, string fName)
: base(fields, fName)
{
}
public CustomField(SPFieldCollection fields, string tName, string dName)
: base(fields, tName, dName)
{
}
public override string DefaultValue
{
get
{
return "XXX";
}
}
public override string GetValidatedString(object value)
{
return value.ToString().ToUpper();
}
}
ii) registered the project as strong key name
iii) build project, then drag and drop the dll into GAC
iv) create a XML file, the code:
<FieldTypes>
<FieldType>
<Field Name="TypeName">CustomField</Field>
<Field Name="ParentType">Text</Field>
<Field Name="TypeDisplayName">Custom Field</Field>
<Field Name="TypeShortDescription">My Custom Field</Field>
<Field Name="UserCreatable">TRUE</Field>
<Field Name="FieldTypeClass">ProjectName, CustomField, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXXPUBLICKEYXXX</Field>
</FieldType>
</FieldTypes>
v) do iisreset
then I go to SharePoint create a Site Column, I don't see the custom field type I deployed, am I missing any step?