0

In SharePoint List I'm updating the column using SharePoint Designer Workflow 2013. For Example if I enter 40 no manually in second item then SPD 2013 will deduct from 100 an update 60 in first row which is working fine.

Now let assume 40 no is wrong entry and I want to change the no from 40 to 30 in second row/item. Then here the problem is the changes is not reflect in first row / item (it should show 100-30 = 70) which shows old value 60 only.

Any suggestion please. enter image description here

enter image description here

enter image description here

  • Could you change the wording of your question to make it more understandable. Could you post exactly what your workflow is meant to do? – Vince2322589 Nov 18 '14 at 7:29
  • Hi Vince I've done the changes. Hope this will be clear. – user3760253 Nov 18 '14 at 7:42
  • Devang - I change the workflow, PFA print screen, In starting only the result is coming incorrect. Its showing result something different – user3760253 Nov 18 '14 at 12:18
1

Is your workflow set to trigger on Item Update? I doubt on this.

There are checkbox in the Edit Workflow page. you should enable "Start workflow automatically when an item is changed"

Please let me know in case more help is required.

enter image description here

EDITED ANSWER as per OP's Comment.

Devang / Vince - Yes after select "then update item in current list" but "Start workflow automatically when an item is changed" now its updating. But its treating as a new value. For example (First Deliver Qty 200-10=190 then 190-15=175) so here if I'm editing the Qty from 15 to 20 so it will show the result (190-20=170) but result which I'm getting is (175-20=155) which is wrong. Any suggestion please. –

Add One more column in list- Previous Balance.

While you are editing the record second time, Set Previous Balance= Old value of Qty, in your case 15

Then Qty= New Qty, in your case 20.

Keep in Mind- When you are adding new record- set Previous Balance=0 or empty.

So as per your comment Previous Balance= 15 and then Qty= 20.

Now change your Workflow logic

The step where you are deducting the quantity

Add if condition

If Current Item:Previous Balance is not empty 

Set Deliver Qty to 200+Previous Balance-Qty

Else

Set Deliver Qty to 200-Qty

Further EDIT 2:

then Calculate   Variable: Balance Qty  minus Current Item:Delevery Qty (Output to vriable:calc)    

Change this to

If Current Item:Previous Balance is not empty 

Calculate Variable: Balance Qty plus Current Item:Previous Balance (Output to Variable: calc )

Calculate Variable: calc minus Current Item:Delevery Qty (Output to Variable: calc )

Else

Calculate Variable: Balance Qty minus Current Item:Delevery Qty (Output to Variable: calc ) 
  • Yes Devang, I'm using "then update item in current list" – user3760253 Nov 18 '14 at 7:45
  • 1
    Are you saying that, you have selected "Start workflow automatically when an item is changed". this means, you have all 3 checkboxes selected, in the image I have provided. – Devang Zala Nov 18 '14 at 7:46
  • I'm using "then update item in current list" but "Start workflow automatically when an item is changed" I've not selected because if i select than my workflow will not update the first item. – user3760253 Nov 18 '14 at 7:50
  • Please specify why( I've not selected because if i select than my workflow will not update the first item) – Devang Zala Nov 18 '14 at 7:55
  • 1
    Change your workflow as per below instruction. (calc2 to calc) from Calculate Variable: Balance Qty minus Current Item:Delevery Qty (Output to Variable: calc2 ) to Calculate Variable: Balance Qty minus Current Item:Delevery Qty (Output to Variable: calc ) And it should resolve, if not Add log, particularly variable:calc, and post them. – Devang Zala Nov 18 '14 at 13:46
1

You should be able to do what Devang said to start the workflow when the item is updated/changed.

If the workflow just needs to calculate a total value for a column why don't you rather create a view and set the Total value to calculate the sum for that column?

enter image description here

Are you using the correct variables when doing your calculation? You are deducting from the Balance and not from the Total when editing the item.

  • Vince - Through workflow almost I've done not sure how to archive this through view which you are saying. what I'm doing is whenever user will enter the Delivery Qty, Delivery Date workflow will check the Purchase No and Part No (some time one purchase no there will be more than one part no) and update the item. I've activated the version so user can check the history using version history. Now here only concern is for every entry workflow is working fine but only if I'm going to edit the item my workflow is not updating the Delivery Qty, Delivery Date & Balance Qty. – user3760253 Nov 18 '14 at 8:35
  • Devang / Vince - Yes after select "then update item in current list" but "Start workflow automatically when an item is changed" now its updating. But its treating as a new value. For example (First Deliver Qty 200-10=190 then 190-15=175) so here if I'm editing the Qty from 15 to 20 so it will show the result (190-20=170) but result which I'm getting is (175-20=155) which is wrong. Any suggestion please. – user3760253 Nov 18 '14 at 9:16
  • This has to do with your use of variables or column your using to calculate the values. You could be using the balance column value and deducting from that. Either you need to calculate the total all over again or you'll need to add another variable and use that to get the old and new value. – Vince2322589 Nov 18 '14 at 9:22
  • Devang, Sorry I'm not much clear on your posted answer. 1) For "Previous Balance" what will be the column type. 2) In workflow the condition you have give so (Please find my above attached workflow print screen) I'm already using if else condition where I've to add this condition.I'm little confuse, If you provide some example or print screen it will be helpful.Thanks – user3760253 Nov 18 '14 at 10:50
  • 1
    In the if statement part of your workflow change the "Variable: Balance Qty" to the "Current Item:PU" and then run the workflow and post your results? – Vince2322589 Nov 18 '14 at 11:12
1

Thanks Devang for your help. Here I'm just posting the final solution provided by Devang. 1) Below workflow need to create. 2) This important while doing entry in Previous Balance Column - When you are adding new record- set Previous Balance=0 or empty. - While you are editing the record second time, Set Previous Balance= Old value of Qty.

Also I got one simple workaround - Instead of Edit if you want you can use the workflow which I've attached in Question section. just enter one more entry and the quantity which you want to deduct enter with minus sign Example :- You received Qty 10 and you have enter 20 so here add one more item for the particular Order No & Part No and Order Qty enter -10 and you will get the result as per expectation. Note :- Here you have to use workflow which I've attached in my question section. Thanks.

enter image description here

0

If you want calculate then you column type as calculated column and write formula of deducting column which you from 100.

For eg: Column a is 40 and you column b as 60(100-40) then u can create column b as calculated column and write formula as : =100-[a]

  • Kaush - that I was already try but the problem was when Qty was deducting in multiple lot in different date the I was confuse to update the list. FYI please fine above list. – user3760253 Nov 18 '14 at 9:10

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.