Post

2 followers Follow
0
Avatar

$Duration Field Syntax in WFR?

I have created a WFR that creates a new Task upon completion of another Task. I need to set the Duration of the new Task to one month. I'm trying to set the $Duration field when the new Task item is created, but I cannot figure out the proper syntax for that field. I have tried 1M, 1 M, "1 M," "1M," and a few others, but no luck.

What is the proper syntax for that field? Or is there a different way to accomplish this?

Thanks!

Doug Smith Answered

Please sign in to leave a comment.

5 comments

0
Avatar

Hello Doug,

Have you tried Months(1)?

Please let me know if this works.

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Hi Roland,

I did try Months(1), and that did not seem to work. However, the Task is being created from a Milestone Template, so I simply hard coded the Duration in the Template and that solved the problem. I am still curious about the $Duration field in a WFR, though.

Thanks!

Doug Smith 0 votes
Comment actions Permalink
0
Avatar

Hello Doug,

I only tested it in a Custom Action, but I presume it would work in a Workflow Rule as well. Actually you can choose if you want that month to take into account non-working days or not. If you use $Duration = Months(1) or $Duration = Months(1, FALSE), the Duration will be set to a Consecutive Month (won't take into account non-working days). However, if you chose to use $Duration = Months(1, TRUE), the duration will be set to a Month (will take into account non-working days). 

Video: https://www.screencast.com/t/FREfDl1Op38

Please let me know if you're able to use Months() function.

Roland Pumputis 0 votes
Comment actions Permalink
0
Avatar

Hi Roland,

You are correct, it definitely works in a CA, but NOT in a WFR. So strange... I configured the WFR to set the $Duration field to Months(1) and Months(1,TRUE), and neither one worked. I then opened the Task that was created from the Template and ran the CA that sets the $Duration to Months(1,TRUE), and that worked.

Doug Smith 0 votes
Comment actions Permalink
0
Avatar

Hello Doug,

I just tested it and it works in a WFR as well: https://www.screencast.com/t/TlDQuNqS

Is it possible that the WFR you created never reaches the action that updates Duration? Is it possible the Evaluation Criteria is not met? Is the Update Field action in a Conditional Action List? 

Roland Pumputis 0 votes
Comment actions Permalink