0

I created a sharepoint site. Their is a source list (Sample System) and a list named (Total month Quantity). I wanted to add every sample quantity which is a column in source list to add up for each month and return it as a value which is stored in the Total month quantity list.

I wrote a code for the same referencing from

I made couple of changes to the code based on my requirements. I can now add a new item and the Total month quantity gets the total sum updated based on the months. Also if I do any changes it is being recorded properly.

But if I delete a item in the source list, the data associated with it is not getting deleted in my linked list (Total month quantity).

Eg: Suppose I entered Item 1: Sample quantity for July as 100, Item 2: Sample quantity for July as 200.

So, based on the code my linked list will show for July the total (100+200=300).

When I delete the Item 1 for July as 100. The linked list should ideally show total for July as 200 now. But what I see is that its still 300.

I am trying very hard but could not get through this. Please help me. Feel Free to reach me out

0

Item deletion will not trigger your workflow so your month total list is not updated. What you could do, instead of delete the item, is to mark an item as deleted (an additional yes/no field ) and exclude deleted (marked as deleted) items from the sum action in your workflow. Or you could change the item value to 0 (and delete it afterwards) which should result in the same outcome.

Other option, which does require coding, is to use event receivers and add your workflow logic to the event receiver. Event receivers can also be triggered on deletion of an item.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.