Hi Experts,
as described here: Build farm solutions in SharePoint 2013
Development of farm solutions has not changed since SharePoint 2010, so this section contains links into the SharePoint 2010 SDK.
I have several Custom Field Types running under SharePoint 2010 which uses custom controls for Rendering.
As of now i had to migrate these Types to SharePoint 2013. I found not even one document which descripes the creation of custom field types using custom controls for Rendering (what i found is client-Rendering) in SharePoint 2013. Since development of farm
solutions has not changed since SharePoint 2010 (ha ha) i did the following:
- Create a new Project
- Add the corresponding SharePoint-Mapped-Folder (Images, Controltemplates, XML, and so on)
- Add new Usercontrol (ascx) as the custom control for Rendering, so references are pointing to Version 15
- Copy Rendering Markup and classes to the Project.
- Build & Deploy
When i then add this custom field type to a list i got a non specific error with correlation-id which i could'nt find even with verbose uls logging.
After one day of Troubleshooting and "Trial and error" i found it! - Let's say it is an documentation-bug..
If the custom control for Rendering is using InputFormSection and InputFormControl the declaration was:
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" Src="~/_controltemplates/InputFormControl.ascx" %><%@ Register TagPrefix="wssuc" TagName="InputFormSection" Src="~/_controltemplates/InputFormSection.ascx" %>
My fldtypes_MyControl.xml has the TAG
<Field Name="FieldEditorUserControl">/_controltemplates/MyControlEdit.ascx</Field>
And further on i have a image-Tag in the custom control for rendering:
<img src="/_layouts/images/MyControl/MyLogo.png" alt="" />
Solution is:
Add the 15-Hive-Folder to the relative and even non-relative pathes in These files:
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" Src="~/_controltemplates/15/InputFormControl.ascx" %><%@ Register TagPrefix="wssuc" TagName="InputFormSection" Src="~/_controltemplates/15/InputFormSection.ascx" %>
<img src="/_layouts/15/images/MyControl/MyLogo.png" alt="" />
<Field Name="FieldEditorUserControl">/_controltemplates/15/MyControlEdit.ascx</Field>
After these changes everything works fine again.
So the development did changed!!!
May you find this useful to add to the next SDK after the preview.