calculation for two fields OR double-sided dependency not working as expected
Hello,
I do have a Status field with (Status) a drop down choice of:
On Schedule
Caution
Overdue
Completed
and I do have a estimated % complete number field (EstComplete).
Now I want to achieve using the calculation field that when the choice "Completed" is made the number field is automatically set to 100. However, when the user decides Complete was set by mistake and choses a different Status the number reverts back to the original value.
I used the following Function code to achieve it, placed at the Calculated of the EstComplete field:
if ([[Status]] == "Completed")
return 100;
else
return [[EstComplete.OriginalValue]];
And of course the same counts for when the user enters 100 at the EstComplete field the status should turn into Completed, so at the Status is added at the Function at the Calculated column:
if ([[EstComplete]] == 100)
return "Completed";
else
return [[Status.OriginalValue]];
I placed both functions to the New and Edit forms.
Unfortunately, I am running into the following issue, when I change the value of the EstComplete field or Status the other field get's set to it's original value of course. Therefor I just left out to both functions the "else ...return [[field.OriginalValue]];"
But this is now resulting that I can't make any other choice or change, for example when I change the Status away from "Completed" or put a different value than 100 into the EstComplete field both fields will be emptied.
At the moment I am unable to find what I am doing wrong.
Any idea?
Please sign in to leave a comment.
Comments
0 comments