Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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: enter image description here

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."

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.