Is it possible to get the Field Type in Tridion 2011 TOM.NET?
The ItemField class has a name and definition, but I don't see the old trusted ItemType property.
I have a feeling I need to use the Definition property, but not sure what is the cleanest way.
Any ideas?
You could use the following way to check the field type:
itemField is EmbeddedSchemaField
itemField is KeywordField
and Itemfield GetType also provides the same information as well.
switch (itemField.GetType().Name)
{
case "EmbeddedSchemaField":
fieldType = "EmbeddedSchema";
break;
case "DateField":
fieldType = "Date Field";
break;
case "MultiLineTextField":
fieldType = "RTF Text";
break;
default:
break;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With