Skip to main content
Mod Moved Comments To Chat
added 4 characters in body
Source Link
Robert Lindgren
  • 24.5k
  • 12
  • 53
  • 79

firstlyFirstly there's no value for properties.AfterProperties in the ItemAdded event receiver. You can see in what receivers After- and Before- properties are available here. 

To get a field's value use properties.ListItem['FieldName'].

To synchronize appropriate items in both lists you should have some unique field to search items. If you have Title field as a unique one you can search item using this CAML query:

var query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Searched Title</Value></Eq></Where>";
var items = list.GetItems(query);

firstly there's no value for properties.AfterProperties in the ItemAdded event receiver. You can see in what receivers After- and Before- properties are available here. To get a field's value use properties.ListItem['FieldName'].

To synchronize appropriate items in both lists you should have some unique field to search items. If you have Title field as a unique one you can search item using this CAML query:

var query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Searched Title</Value></Eq></Where>";
var items = list.GetItems(query);

Firstly there's no value for properties.AfterProperties in the ItemAdded event receiver. You can see in what receivers After- and Before- properties are available here. 

To get a field's value use properties.ListItem['FieldName'].

To synchronize appropriate items in both lists you should have some unique field to search items. If you have Title field as a unique one you can search item using this CAML query:

var query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Searched Title</Value></Eq></Where>";
var items = list.GetItems(query);
Source Link

firstly there's no value for properties.AfterProperties in the ItemAdded event receiver. You can see in what receivers After- and Before- properties are available here. To get a field's value use properties.ListItem['FieldName'].

To synchronize appropriate items in both lists you should have some unique field to search items. If you have Title field as a unique one you can search item using this CAML query:

var query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Searched Title</Value></Eq></Where>";
var items = list.GetItems(query);