Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

i have two lists in sharepoint 2010. one that shows: unique name | highest value | value. second list shows: name | value.

for example: first list shows (at first time): gady | 8 | 8. bob | 7 | 7.

second list shows: gady | 5, gady | 2, gady | 1,

i want to update the value on the first list (in the third column) so it substract the values of the second list from it.

for example after i created the last row of the second list, the first list should be look like this : gady | 8 | 0

(8-5-2-1=0)

the problem is i want to do this calculation every time a row is created or changed in the second list. because if someone only wants to update one of the values of the second list the first list will not be changed correctly (or at all).

i want to avoid mistakes in calculation.

(the senario is: i created the first list. gady | 8 | 8. i created one row in the second list : gady | 5 if i only use workflow on create the first list will be gady | 8 | 3

then i want to change the row i created in the second list to : gady | 7. i will get in the first list gady | 8| -4. but i wanted to see : gady | 8 | 1. )

can i do this in workflow (onchange of the second list) ? how can i do that?

thanks , gadym

share|improve this question
    
You should significantly improve your accept rate and pay more attention to proper formatting of your question. –  Ondrej Tucny Dec 13 '11 at 16:29
add comment

migrated from stackoverflow.com Dec 17 '11 at 16:38

This question came from our site for professional and enthusiast programmers.

1 Answer

Create additional template_value column in the second list that will hold a copy of "value" column. (as you named it) - just add 'set field to value' in your current workflow. Then add another workflow that will be triggered after second list is edited. Once you edit item the workflow should:

  • add a temporary value to value in the first list (so we're back to previous value in first list)
  • then substract the values as you do for the original workflow
  • tehn copy the new value to your template column
share|improve this answer
add comment

Your Answer

 
discard

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