For life cycle event case Need to create the new task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 09:59 AM
Can anyone please help me on the below query.
For life cycle event case Need to create the new task , below is the task
Will you require a mobile phone
Yes
No
Once the task is created and its assigned to preboarding specialist, preboarding specialist will open the task from employee service portal(esp) and if they want candidate to mobile click yes and submit the task, if they dont want candidate to mobile click No and submit the task
Will you require a mobile phone
Yes-
No
If the preboarding specialist click on Yes(Task state will closed complete and another dependent task needs to create)
If the preboarding specialist click on No(Task state will closed incomplete and dependent task will not create)
below is the screenshot once preboarding specialist submit it will update the state on native instance
Please help me on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 10:13 AM
The easiest way to accomplish this would be with a Flow. Your flow can trigger based of that specific child HR Task being completed. You can pull in the variable to see if yes or not was selected. If yes, then create the necessary child task for the other team. If no, the flow ends. This would not interfere with the existing lifecycle event activities.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 11:04 AM
@nikhitha24 Is Order Mobile Phone task a Record Producer or a Catalog item? If it is a record producer, I am assuming it generates an HR Task when the form is submitted. If the aforementioned assumption is correct then inside the record producer script you can check
if(producer.will_require_phone=='yes'){
current.state='10'; //Set the newly created task to ready
current.assigned_to='';//Set sys_id of assgined_to here
}
else{
current.state='7'; //set the newly created task to cancelled.
}
In order to set the status of the HR task presenting the record producer, you can create an onSubmit script, inside the onSubmit script you can fetch the sys_id of the current task as follows.
var hrTaskID = document.getElementsByClassName('task-content')[1].id.split('_')[0];//fetches the task sys_id;
if(g_form.getValue('will_require_mobile_phone')=='yes'){
//Call a script include method and provide the task sys_id and update the task state to closed complete
}
else{
//Call a script include method and provide the task sys_id and update the task state to closed incomplete
}
Hope this helps.
