Issue with Automatically Initiate Document Tasks

LuLe Game
Tera Expert

When using "Automatically Initiate Document Tasks" a document Task is initiated when state in HR Case has been moved to "Ready" State. But, when the HR Case is "Work in Progress" that also is triggering the Document Task. I am working in a process using a WorkFlow that if someone approves an HR Case, the State field will be "Ready" but, if it is rejected, the State field will be "Work In Progress". So, my question is that if is there something I can do to trigger the Document Task "On Demand", by using any script or any configuration for this process. Currently, the only way I know to trigger a Document Task is by using "Automatically Initiate Document Tasks" feature (case option), so I am not sure why the State field is triggering this or how can I change that. I will leave some pictures here about the form in HR. 

1.- Workflow is adding approver but after rejection and moving the State field to Work in Progress (Approvers related list from an HR Core case table), Document Task is still triggering

LuLeGame_0-1708618264264.jpeg

 

2.- The Document Task creation has no problems. But I don´t know how to not trigger it when is rejected, and supposedly it only triggers when you move the Case to "Ready" State.

 

LuLeGame_1-1708618264267.jpeg

 

 

3.- I am using this case option as this is the only way I know to initiate a document task.

 

LuLeGame_2-1708618264268.jpeg

 

1 ACCEPTED SOLUTION

LuLe Game
Tera Expert

I was able to fix this by finding the Out-of-Box Business Rule "Initiate document tasks if configured". Here you need to find out-of-the-box Script Include "HRDocumentTemplateUtils().isAutoInitiateDocTasks" which already have an extended Script Include. With this, you will be able to change the code to your needs. 

View solution in original post

1 REPLY 1

LuLe Game
Tera Expert

I was able to fix this by finding the Out-of-Box Business Rule "Initiate document tasks if configured". Here you need to find out-of-the-box Script Include "HRDocumentTemplateUtils().isAutoInitiateDocTasks" which already have an extended Script Include. With this, you will be able to change the code to your needs.