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

by oscar 8/12/2008 10:29:12 AM

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

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Related posts

Comments

Add comment


 

  Country flag





Live preview

11/21/2008 3:21:49 PM

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About Me

Oscar Medina I am a SharePoint Solutions Architect based out of San Francisco, California.
You can read more about me here

E-mail me Send mail
View Oscar Medina's profile on LinkedIn

Calendar

<<  November 2008  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar

Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

Sign in