List Event Handler ItemUpdated Event – How to set a form field value programmatically

by Oscar 13. August 2008 01:29

On my current project we had a requirement where based on the user browsing the SP Site, I needed to set the value of a MultiChoice Field to yes/no.

At first, I had difficult time figuring out why my code was not updating the value of my field.  Here is what works!  Specifically, the SystemUpdate(false) is what did it.

//always set the locked value to YES.
  properties.AfterProperties["Locked_x0020_and_x0020_ready_x00"] = "Yes";

  try
  {
      DisableEventFiring();
      properties.ListItem.SystemUpdate(false);
      EnableEventFiring();

  }
  catch (SPException ex) {}

Hope this helps you,
O

Tags:

Comments

9/25/2008 3:37:43 PM #

Hi,

I have a check box in my custom list. Now I want to send a email to users when the check box is checked out.

Thanks & regards,
K Senthilrajan

Senthilrajan Kaliyaperumal United States | Reply

9/29/2009 3:59:57 AM #

Hi Senthilrajan,

You should be able to using a List Event Handler, then sending an email when the checkbox is checked.  Look at trapping the even when the list item is being edited.

Hope this helps,
Oscar

Oscar United States | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About Oscar

Oscar Medina - SharePoint Solutions Architect

I am a SharePoint Solutions Architect and Managing Partner at SharePointAce Consulting Group, LLC.  I have over 13 years of software development experience. 

Previously a Consultant at Microsoft Consulting Services (MCS) North West Region with focus on the SharePoint Products and Technologies Platform.  I have been involved with SharePoint since it's first version (SharePoint 2001) and have grown more gray hair providing solutions ever since :)

Author of the CQWP – Recurring Calendar Events at http://cqwprce.codeplex.com

 

Follow SharePointAce on Twitter! Follow me on Twitter.


Contributor to the book:

 

Occasional Speaker at SharePoint Saturday - SharePoint Saturday

RecentComments

Comment RSS