I am working on two SharePoint list:List 1 is overview of servers including: Server Name, Purpose, status etc.. List 2 is change log on each server, it got an lookup column that connects to Server Name in List 1. What I want to do is each time a new log is added/deleted/updated in List 2, it will automatically add/delete/update in List1, because there will be several logs for one server and we are not using Infopath for repeating section, I decide to use C# code and build a Event Receiver. But I only start with c# and have no idea how to write them at all. Now I only got this. Could anyone show me how the code would be like, I will be so grateful.
using System;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;
namespace AppendListColumn.AppendColumn
{
/// <summary>
/// List Item Events
/// </summary>
public class AppendColumn : SPItemEventReceiver
{
/// <summary>
/// An item is being added.
/// </summary>
public override void ItemAdding(SPItemEventProperties properties)
{
base.ItemAdding(properties);
}
/// <summary>
/// An item is being updated.
/// </summary>
public override void ItemUpdating(SPItemEventProperties properties)
{
base.ItemUpdating(properties);
}
/// <summary>
/// An item is being deleted.
/// </summary>
public override void ItemDeleting(SPItemEventProperties properties)
{
base.ItemDeleting(properties);
}
}
}
Thanks a lot, Celia