Custom field type not installed properly error.

This is quite a common error when developing custom field types on SharePoint. Few quick points to keep an eye for, and they are:

  • Ensure that the field type matches the parent type – for example, if you inherit from SPFieldText then ensure that the ParentType attribute on the fldtypes_<fieldname>.xml file has the value of Text.

  • Ensure that you do not clash with SharePoint Internal names – this can be easily avoided by having a standard naming standard for your SharePoint development. I tend to prefix my custom field names with HM, example would be HM<fieldname>.

  • Ensure that the FieldTypeClass is specified correctly – on the fldtypes_<fieldname>.xml file, ensure that the FieldTypeClass attribute is specified correctly. Should be specified as “namespace.classname, assembly name, version, culture, publickeytoken

Happy Coding!


Retrieving user information from PickerEntity control

Need to retrieve user information, such as email from a PickerEntity control? The code snippet below shows you how to, for this example get the user email. 

image

Do note, I also have a post on how to do this from a People and Group field here.

Happy coding!


Retrieving user information from Person or Group field

Ever had to retrieve user information from a Person or Group field? In my case, I had to get the user email, and the code snippets below shows you how.

If the field has been set to only allow single selection such as

image

the use the following:

image

Where oItem is the SPListItem object, and [“Manager”] is the field display name.

However, if the field has been set to allow multi-selection such as

image

then use the following:

image

Where oItem is the SPListItem object and [“Team”] is the field display name. And sb being a StringBuilder object that I’ve used for this purpose.

Happy coding!


Follow

Get every new post delivered to your Inbox.