I have a requirement where I have to update a field on a list based on the value of the same field in another list. However, it has to update the field of the same list item. I already started writing the item updating event receiver but am stuck as to how to get the corresponding list item.
List 1 has field A and field B
List 2 has field A and field B
Both lists are in the same site.
Field A is a column that contains numbers to identify an item. Field B is a column that contains a comment. List 1 has both fields complete. List 2 has all of the field A values, but has no field B values.
Example:
List 1
Field A | Field B |
957 | Comment 1 |
834 | Comment 357 |
List 2
Field A | Field B |
957 | |
834 |
So, if I make a change to list item 957 in List 1 by changing its field B from 'Comment 1' to 'Comment 257', how do I replicate the change in List 2's list item 957 field B? The desired effect would be for List 2's list item 957 to have its field B show 'Comment 257' to match List 1. I am thinking that I need to use SPQuery, but am not sure.