I have got two lists. One is with dates from StartDate, to StopDate. It's called "Wpisy".
| Contract | Worker | StartDate | StopDate | Percent | ID |
Secound list is with description first list element, by element in a days. This list called "Szczegoly".
| Contrakt | Worker | Day | Percent | ID_IN_WPISY |
But i don't know how get ID from list "Wpisy".
At Items Adding when I add this code:
item["ID z Czas Pracy Wpisy"] = properties.AfterProperties["ID"];
But in this situation I getting null.
At Items Added I write this code:
public override void ItemAdded(SPItemEventProperties properties)
{
base.ItemAdded(properties);
if (properties.List.Title == "Wpisy")
{
var someList = properties.Web.Lists["Szczegoly"];
var item = someList.Items.Add();
item["ID z Czas Pracy Wpisy"] = properties.ListItemId;
item.Update();
}
}
But then i will got adding once, and only last element, with no any of elements:

Please help me. I want to get something like cascading deletting. When I will delete on "Wpisy", in "Szczegóły schould be deleted a element's too."