Announcement

Collapse
No announcement yet.

Change Task Time Default on Workflow

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change Task Time Default on Workflow

    Hey Guys,

    When creating a Task using a workflow, there is no option to change the Task Due Date Time. So when the workflow triggers it create the task and the Due Time is Always 20:00, That said Pop-up Reminders won't help since they will display on non-working hours ( At least in my case with a 9am-5pm work schedule) Any possibility to add the Due Date Time option? Any Work Around meanwhile? Thanks!

  • #2
    Hello
    You can set this field in workflow with formula.
    This field name is dateEnd (type - dateTime) and dateEndDate (type - date). If you set dateEndDate - Due Date will be shown as date w/o time. If you set dateEnd - this field will be shown as datetime

    Comment


    • #3
      tanya thanks for above, I understand the concept but I don't know the correct syntax of the expression. Since I need to create a task with a date and a time I will use dateEnd field so:

      dateEnd = Field_with_date , 10am; What is the correct syntax of above expression - Thanks in advance!!

      Comment


      • #4
        Hello


        Try this example
        dateEnd=datetime\format(targetEntity\attribute('cr eatedAt'),null,'Y-m-d 10:00');

        Comment


        • #5
          Hey Tanya when used as above it will produce the following date - Nov 29, 2016 05:00 -- I try to change the expression format to 'd-m-Y 10:00' and give me an Invalid date - Also I need to used the attribute of a target custom Entity but then workflow won't show anything any Ideas? thanks

          Comment


          • #6
            Hello
            It looks weird, but catch it
            We need to set the field in UTC, so we need to get the timezone time difference.
            Code:
            $end=datetime\format(targetEntity\attribute('createdAt'),'UTC','YYYY-MM-DD 10:00');
            $minutesDiff=datetime\diff(datetime\now(),datetime\format(datetime\now(),null,'YYYY-MM-DD HH:mm'),'minutes');
            $end=datetime\addMinutes($end, $minutesDiff);
            dateEnd=$end;
            About second question
            With Workflow UI it is not possible for now. You can get targetEntity attributes with Entity Manager

            Comment

            Working...
            X