- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 07:05 AM
I have 3 SCTASK , I have a requirement to set 3rd task due date to after 5 days based on 2nd task "actual end" date How to set SCTASK due date based on 2nd task "actual end" date in flow designer
Please help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 07:38 AM
Hi @Nandini DM
At the step you create the 3rd sctask, you can use script to calculate the due date based on the actual end date of 2nd sctask.
Sample below.
//replace <_5__create_catalog_task> by the step of 2nd sctask
var previous_task_actual_end = fd_data._5__create_catalog_task.catalog_task.work_end;
var gdt = new GlideDateTime(previous_task_actual_end);
gdt.addDays(5); //number of days
return gdt.getDisplayValue();
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 07:38 AM
Hi @Nandini DM
At the step you create the 3rd sctask, you can use script to calculate the due date based on the actual end date of 2nd sctask.
Sample below.
//replace <_5__create_catalog_task> by the step of 2nd sctask
var previous_task_actual_end = fd_data._5__create_catalog_task.catalog_task.work_end;
var gdt = new GlideDateTime(previous_task_actual_end);
gdt.addDays(5); //number of days
return gdt.getDisplayValue();
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 07:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 07:10 PM
Hi @Nandini DM
It's most probably because wrong syntax in your script. Can you help to capture the steps in your flow between 2nd and 3rd tasks?
Ref: Inline scripts
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2023 11:57 PM
@Tai Vu Thank you ,it is working now 😀