0

I'm new to Event Receivers and I never have done one. Here is my situation, I have 2 lists. First list contains fields: Software Name, Quantity, Used, Available, and COUNT [Software Name: (Count Related)] from second list. Second list contains field: Software Name (Lookup from first list). How do I calculate and update fields Used and Available in the first list when a new item is added or updated in the second list? Any examples or links are really appreciated

Regards,

Fernando

FGomez
  • 1
  • Have you tried anything yet? If yes, post it and then ask what you are doing wrong. If not, first try it out yourself. – CinCout Nov 06 '14 at 14:37
  • Use an ObservableCollection. http://stackoverflow.com/questions/12785019/listt-firing-event-on-change – Marton Nov 06 '14 at 14:42
  • Like I said, I'm new and I have never done an event receiver but so far what i have is this for the ItemAdded but I don't know how to updates the other fields in the other list. – FGomez Nov 06 '14 at 16:16
  • Here is my code for the ItemAdded: base.ItemAdded(properties); try { base.EventFiringEnabled = false; using (SPSite site = properties.OpenSite()) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists["License Tracking"]; SPItem item = list.Items.Add(); item["Title"] = properties.ListItem["Title"]; item.Update(); } } } – FGomez Nov 06 '14 at 16:17

0 Answers0