Post

2 followers Follow
0
Avatar

Validation Rule to check the value I am changing

When the value of 'status' is changed to 'on hold' I want to check if it was already on hold. GetPreviousValue appears to get the value for the last change I made on *any* work item, not just the current work item, meaning if the last item i worked on was put on hold the Validation Rule will prevent me putting any other task on hold (until I perform some other action).

GetPreviousValue($C_TaskStatus)='On Hold' &&$C_TaskStatus='On Hold'

 

How can I check if the task is already on hold yet? is there someway to use CurrentObject to indicate I want to GetPreviousValue of the task I am currently working?

ezeriah stacey

Official comment

Avatar

Hello Ezeriah,

GetPreviousValue() only returns the previous value of the field that is being currently changed on the current object. Also, I don't think the value can change from On Hold to On Hold.

I hope this clarifies the behaviour.

Best regards,

Roland

Roland Pumputis
Comment actions Permalink

Please sign in to leave a comment.

4 comments

0
Avatar

Thanks Roland, unfortunately the visibility/access of the hold button depends on checking the task status. It happens that people open the task in two separate tabs and put it on hold on one, the hold button is still visible on the other tab and it is then put on hold twice. The goal is to prevent this.

I have found that GetPreviousValue() in the validation rule prevents me putting a brand new task that has never been on hold hold, and through trial and error it looks like it happens if the last action I took on a different task was changing the status to On Hold.

I really want to use the validation rule for the editable error message. I have experimented with an If: $C_TaskStatus<>'On Hold' in the Hold action, but the error message is undesirable.

ezeriah stacey 0 votes
Comment actions Permalink
1
Avatar

Hi Ezeriah, 

What is the consequence of putting it on hold twice? Is there an error? 

Thank you,

Roland

Roland Pumputis 1 vote
Comment actions Permalink
0
Avatar

The consequences of putting it on hold twice is that when we calculate the time spent on the task (minus time spent on hold) we get a significantly reduced value. It looks like we are spending much less time working than we actually are. 

ezeriah stacey 0 votes
Comment actions Permalink