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-15-2022 08:31 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 08:41 AM
for the state value try writing as below
gr.state= '3' ;
and for closing the current record. sometimes we face issues using set values activity in workflow .
so better to add a run script activity and manually query the current record using glidrecord object and close it.
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-16-2022 11:23 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 12:46 AM
if its right then in the first screen shot second line it should be current.sys_id instead of current.parennt
also in the second screenshot you are trying to close a child record of current record. there before the gr.update add these two below lines
gs.info('task closing':+ gr.sys_id)
gr.setWorkflow(false);
here the first line is to check whether the child task is getting closed are not.
then the second line is to prevent if any BR is interrupting .
add this 2 lines befro gr.update in the second screenshot. and let me know the resutl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 01:19 AM
Hi
Yes, you are right. In first screenshot I am closing record. So yeah it should be current.sys_id. I have updated it-
Below is to close child task so I have updated as below-
No log came out-
And workflow is showing as task is cancelled-
I think which is correct?