How to auto close Request if no action taken after 2 days of Date of Dispatch field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2022 02:21 AM
Hi Team,
I have a Record Producer which is mapping to a table u_physical_security.
Record Producer is having a variable called Date of Dispatch this variable is mapped to u_physical_security table's field Date of Dispatch.
Workflow running for this RP is having three level of approvals and multiple catalog tasks. First approval generated - It got approved then 2nd approval generated - t got approved the 3rd approval generated. After that tasks generated for u_physical_security_task.
My requirement is- If no action is taken after 2 days of Date of Dispatch field then auto close the Physical Security Task and Physical security request.
This action can be on any level of approvals or tasks- If no action is taken on approval after 2 days of Date of dispatch then set approval as No longer required and auto close Physical security request.
if first approval is approved and then no action is taken after 2 days of Date of dispatch on 2nd approval then set approval as No longer required and auto close Physical security request.
If all approval approved and task generated then if no action is taken after 2 days of Date of dispatch on2nd task then close Physical security task and Physical security request.
Please help me to get this

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2022 04:58 AM
Hi Rekha
Please see the below screenshot. I did your requirement for first level(first approval group). consider it as a base and build rest of it as per your requirement
Now in the first and second activity I have set the timer as well as triggered the approval.
now in the activity 1 (Timer) I have selected due date as a date field. you can use your dispatch date field .
and I have set the timer to wait till 2 dates after the due date. then after waiting two days it will go to the 4th activity (IF activity)
In the activity 2 I have triggered the first level of approval. you can do it as per your requriement.
now in the activity 3(Run Script) I have created a workflow scratchpad variable (workflow.scratchpad.level1) to set it as true so that we can determine whether the approval has happened before or after the timer is expired.
now in the 4th activity (IF Activity) we will determine whether the approval was given within the timer
here in the if the activity we will determine whether the approval is given on time or not using the scratchpad variable we set in activity 3 as shown below
now if the 4ths activity(IF activity) returns yes. then we will move on to next set of approvals and timers. if that value is no that means approval is not given in the right time . so we will navigate to 5th activity which is approval action. where we disregard pending approvals.
then we will move on to the next approval and will create a timer same as before. and repeat it for 3 times as per your requirement
Please mark it as Correct/Helpful If my answer is helpful in any way,
Best regards,
Thameem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 01:12 AM
Hi
Thank you for response.
Please see below screenshot-
I have put timer (circled above). Timer is working fine but the if condition is going in Yes branch while it should go to No as Task is still open.
This is the script for if activity to check if task is closed or not-
Please help me why it is going in Yes branch in If activity,
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 01:57 AM
Hi rekha,
in the if condition you are checking if any of its child tasks state is '3'. so that is working according to your logic. its fetching a child record for the current record and checking the first child records state value.
Please describe here what is your condition that needs to be checked in the if condition activity.
for testing put that entire script in background script try running it. instead of current.sys_id. you directly add the sys_id of the record that workflow is running for
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 02:27 AM