(Manage Life Cycle Event) Activity Set is not getting triggered using Trigger Type: Advanced
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago - last edited a month ago
Hi All,
I am using advanced trigger type to check if the previous activity set is completed or not using the below script, along with the additional check in HR Profile (Parent Case->HR Profile->Custom Field).
Expectation: If there is a value is the (Parent Case->HR Profile->Custom Field) I am straight away triggering the current Activity Set. If there is no value in the custom field then I am checking weather the previous Activity Set is competed or not. If completed then trigger the Current Activity Set.
var job_check = parentCase.subject_person_hr_profile.u_custom_field.toString();
if(job_check)
{
return true;
}
else
{
var prerequisiteActivitySetIds = ['sys_id']; // SysId of Previous Activity Set
if (!hrTriggerUtil.checkActivitySetsCompleted(prerequisiteActivitySetIds))
{
return false;
}
else
{
return true;
}
}
The above configuration works when there is a value in the Custom Field it straight away trigger the current Activity Set and did not check if the previous activity set is completed or not. However when there is no value in the Custom Field, then even the previous Activity Set is completed the current Activity set is not getting triggered.
I also tried to just check the dependency on the previous activity set through script using below code but it didn't work. I have also cross check the sys_id of the previous activity set but still it's causing an issue.
var prerequisiteActivitySetIds = ['sys_id']; // SysId of Previous Activity Set
if (!hrTriggerUtil.checkActivitySetsCompleted(prerequisiteActivitySetIds)){
return false;
}
else{
return true;
}
Thanks in Advace!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hi @Wessel van Enk @SANDEEP DUTTA
I got the issue is because the Advance Script gets evaluated every 4 hours. This is based on the value in the Evaluation Interval field on the activity set. That's why the script was not triggering immediately after the first task was completed.
Thank you for your suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
@Rohit_Singh_19
Thanks for the reply. This is an OOB property indeed. It was frustrating for me as well in the beginning 😅 Luckily that solved the issue. Have fun with the lifecycle events!
