locked
Customm Lookup Field Save Prob RRS feed

  • Question

  •  

    I had created Custom Lookup Field.In that user control added one dropdown field to show Items.

    But when i press ok It is showing error

     

     CustomField Not installed properly,Go to list setting and delete this fields.

     

    In Usercontrol .cs file i had added OnSaveChange event ,But it is not calling

    Thanks.

     

    Friday, May 16, 2008 6:44 AM

Answers

  • Then it could be a problem in the XML file - this is hard to troubleshoot - what I do is start from scratch (make a field that inherits from SPField for example) and slowly add the code and xml modifications I want-  and check each time if it breaks.

    Saturday, May 17, 2008 10:11 AM
  • I can only repeat what I told you - start from nothing - a custom field type that inherits from SPField and does nothing. Do not override any of the functions. test that. does it fail?

    Answer is Yes - you have made a big mistake in how to create a basic custom field type. see the walkthrough in msdn.

    Answer is No  - add one override that you want. check again. and so on.

     

    Tuesday, May 20, 2008 6:24 AM
  • I had tried out simple Custom Field that inheriates from SPField.Without using any user control.

    It is also giving me same error.

     

    'FieldControlField'  is my Custom Field Class..

     

    FLDTYPES.xml FIle Structure :-

     

    <FieldTypes>
     <FieldType>
      <Field Name="TypeName">FieldControlField</Field>
      <Field Name="TypeDisplayName">FieldControlField</Field>
      <Field Name="TypeShortDescription">FieldControlField</Field>
      <Field Name="UserCreatable">TRUE</Field>


      <Field Name="FieldTypeClass">ListList.FieldControlField, ListList, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5</Field>


      <Field Name="SQLType">int</Field>
      <Field Name="InternalType">FieldControlField</Field>
      <Field Name="Sortable">TRUE</Field>
      <Field Name="Filterable">TRUE</Field>
      <RenderPattern Name="HeaderPattern">...</RenderPattern>

     

     

     </FieldType>
    </FieldTypes>

     

     

    I had deploued this Xml File in  C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML

     

    Thanks

    Tuesday, May 20, 2008 12:21 PM

All replies

  • This could be an indication that something in the custom code is throwing an error.

    I sugegst you connect a debugger and see where that happens. most usually it is because the field control or the custom field class have overriden the "value" and you did not implement a check that the object is not null before converting it tostring. but it can be anything in the code that will throw an error without being trapped.

    Friday, May 16, 2008 8:02 AM
  •  

    I checked with debugger.It not show any error in code.After Add  my own Custom column,when press ok ,It shows that error.

    before going to OnSaveChange Method it fires error.

    OnSaveChange method will not call...

     

     

    Thanks.

    Friday, May 16, 2008 9:45 AM
  • Then it could be a problem in the XML file - this is hard to troubleshoot - what I do is start from scratch (make a field that inherits from SPField for example) and slowly add the code and xml modifications I want-  and check each time if it breaks.

    Saturday, May 17, 2008 10:11 AM
  • Hi,

     

    I already inheriated my CustomField with SpField . In My User Control File DisplayAsNewSection(),InitializeWithField() event are firing properly.Only i had issue with Event OnSaveChange(),as it is not firing.

    It turns error Field typeNot installed properly.

     

     

    Thanks,

    Shubha

     

     

    Tuesday, May 20, 2008 6:15 AM
  • I can only repeat what I told you - start from nothing - a custom field type that inherits from SPField and does nothing. Do not override any of the functions. test that. does it fail?

    Answer is Yes - you have made a big mistake in how to create a basic custom field type. see the walkthrough in msdn.

    Answer is No  - add one override that you want. check again. and so on.

     

    Tuesday, May 20, 2008 6:24 AM
  • I had tried out simple Custom Field that inheriates from SPField.Without using any user control.

    It is also giving me same error.

     

    'FieldControlField'  is my Custom Field Class..

     

    FLDTYPES.xml FIle Structure :-

     

    <FieldTypes>
     <FieldType>
      <Field Name="TypeName">FieldControlField</Field>
      <Field Name="TypeDisplayName">FieldControlField</Field>
      <Field Name="TypeShortDescription">FieldControlField</Field>
      <Field Name="UserCreatable">TRUE</Field>


      <Field Name="FieldTypeClass">ListList.FieldControlField, ListList, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5</Field>


      <Field Name="SQLType">int</Field>
      <Field Name="InternalType">FieldControlField</Field>
      <Field Name="Sortable">TRUE</Field>
      <Field Name="Filterable">TRUE</Field>
      <RenderPattern Name="HeaderPattern">...</RenderPattern>

     

     

     </FieldType>
    </FieldTypes>

     

     

    I had deploued this Xml File in  C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML

     

    Thanks

    Tuesday, May 20, 2008 12:21 PM