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

I have Two lists. One with dates Stard, and dates Stop:

      Contract | Worker | Day Start   | Day Stop   | Percent         
     --------------------------------------------------------
        Con1   | Paul   | 2012-10-12  | 2012-10-15 | 1/8

And Secound which describing by details first list:

     Contract   |   Worker   |   Day      |   Percent
     ------------------------------------------------
     Con 1      |    Paul    | 2012-10-12 |    1/8
     Con 1      |    Paul    | 2012-10-13 |    1/8
     Con 1      |    Paul    | 2012-10-14 |    1/8
     Con 1      |    Paul    | 2012-10-15 |    1/8

I got this made by Adding Items. Now I would like to delete this in this sime order. So if I delete in first list contract 1 I would like too delete from secound describing list all records which are bounded with record from first list. I tried to do this by Deleting Cascade, but then I can't Bound elements in corelating field when I use Adding Item. Here Is a Code:

 SPListItem item = lstOtherList.Items.Add();
               item["Kontrakt"] = properties.AfterProperties["Kontrakt1"];
               item["Pracownik"] = properties.AfterProperties["Pracownik1"];
               item["Dzien"] = dzienStart;
               item["Procenty"] = properties.AfterProperties["Procenty"];
               dzienStart = dzienStart.AddDays(1.0);
               item.Update();

When I dded Cascade Deleting to the column "Szczegoly" enter image description here

Any elements in this field called "ID Czas Pracy Wpisy" didn't show. I must click and choose edit button to the element and next save, to the element shown.

enter image description here And only elements edited are deleting by deleting cascade. How bound elements to cascade deleting.

How should I add lookap values in the Item Adding to write ID Values from List "Wpisy" without klikink every element edit and next save.

If I try this code:

String lookupFieldName = "Kontrakt1"; String lookupFieldStringValue = Convert.ToString(properties.AfterProperties[lookupFieldName]); item["ID Czas Pracy Wpisy"] = lookupFieldStringValue;

The debuger writes to me that the field "ID Czas Pracy Wpisy" is only for reading. Please please help me

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.