whenever line Manager.manager also not approved with in five days then request will be cancelled

Nareshpatel
Tera Expert

when a line manager not approved with in 3 days then the notification goes to linemanager.manager . If linemanager.manager also not approved with in five days( this period line manager should be also able to approve ) , then the request will be cancelled.

Please help anyone to script provide

2 ACCEPTED SOLUTIONS

AshishKM
Kilo Patron
Kilo Patron

Hi @Nareshpatel ,

You can use Timer logic parallel to manager approval and check for 3 days, after the Timer , add the If condition and check if approval record approved by manager or not. If not then add next level manager approval and apply the same timer logic.

 

Let us know if you are applying this logic in some workflow/or/flow.

 

-Thanks,

AshishKM

 


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

View solution in original post

Hi Ashish,

Client want scheduled script  only (because of many cat_items there , )   instead of flows designer or workflows, Could you please provide valid script ,thanks.

View solution in original post

8 REPLIES 8

Ashish Parab
Mega Sage

Hello @Nareshpatel,

 

I will suggest you to add this logic in flow instead of script. You can easily wait and add new approval in the flow.

 

Let me know if you need any help with the flow actions.

 

Please mark this as "correct" and "helpful" if you feel this answer helped you in anyway.

 

Thanks and Regards,

Ashish

Hi Ashish,

Client want scheduled script  only (because of many cat_items there , )   instead of flows designer or workflows, Could you please provide valid script ,thanks.

Hi @Nareshpatel , 

Writing schedule script code for this requirement not a good option because of various reason.

The best way to reduce the work, either you create a sub-workflow/or/sub-flow for this need. 

However cancelling the request is not the good solution for catalog based request which are pending for approval. This will create more work for everyone in the team along with requester user.

 

Still you want to create schedule script logic then write code on sysapproval_approver table and read all record which are in 'Requested' status and created 3 days before. Here if any record comes in filter then you can trigger event for email notification to manager's manager but at this stage "adding manager's manager approval in the running workflow will create some workflow issue", but manager's manager can approve with delegate access without interrupting any workflow issue. So best way to generalize the logic and place it within the workflow rather than using some schedule job with script code.

 

-Thanks,
AshishKM


Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution

I informed above points to same  , but they want to scheduled script .Could you provide any valid inputs pls