in

SharePoint University

Clean slate. Nothing but SharePoint.
Go, SharePoint!

Sharepoint Custom field type class

Last post 10-03-2007 11:27 PM by arun_gp. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 09-27-2007 2:45 AM

    Sharepoint Custom field type class

    Hello Everybody,

    I am creating a custom field type for Sharepoint List. While adding my custom fieid to a sharepoint list, i want to check for a condition and allow adding the field only if the condition is met. If the condition returns false I want to prompt the user an error message in the Field Settings page itself and restrict adding field.
    I have tried to code this in overridden methods  OnAdded() and Update(). But its not working. I am new to Sharepoint and I dont know much about the inner working of Sharepoint.
    Please give me some idea to slove this problem.


    Arun Dutt

  • 09-27-2007 10:12 AM In reply to

    Re: Sharepoint Custom field type class

    Arun,

    In order to check when columns are added to a list you will need to make use of event recievers. These are custom classes derived from SPItemEventReceiver, SPListEventReceiver or SPWebEventReceiver. Just about all of these have to be registered programattically inside of SharePoint. I believe the SPItemEventReceiver can be registered via a Feature. I would spend a lot of time investigating these classes.

    Hope this helps!

  • 09-27-2007 2:02 PM In reply to

    • gmanrodt
    • Top 500 Contributor
    • Joined on 06-22-2007
    • Miineapolis, MN

    Re: Sharepoint Custom field type class

  • 10-01-2007 2:54 AM In reply to

    Re: Sharepoint Custom field type class

    Hi Greg,

    Thank you for the reply. I just visited the links you have given and it is really helpful for me

    Arun  

  • 10-01-2007 2:58 AM In reply to

    Re: Sharepoint Custom field type class

     Hi westdccs,

    Thank you for the reply. I think these event receivers can do my job. 

    Arun 

  • 10-03-2007 11:27 PM In reply to

    Re: Sharepoint Custom field type class

     Hi westdccs,

     I have solved the problem. Thanks for your help. The following code worked for me.

        public override void FieldAdding(SPListEventProperties properties)
            {              
                   // my logic here...
              
            }

     

    Thanks & Regards,

    Arun

     

Page 1 of 1 (6 items)

Need SharePoint Training? Attend a SharePoint Bootcamp!
Forum content (c) original posters. Everything else (c) 2008 SharePoint Experts, Inc.