In manage lifecycle event I want to trigger activity Set before one day for "Indian" user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 04:34 AM
I want to trigger activity set before one day for Indian user but for other user it should be as it is.
How we can achieve with trigger type as "Advanced" or is another way
Thanks in Advance..!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 04:47 AM
@Rameshwar Bera3 Use "Combination" trigger type. You will get to use "Date", "condition" & "other activity sets" combination. In "Date", you can write date logic and in "Condition", you can write India user logic.
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 05:45 AM
@Rameshwar Bera3 If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 05:45 AM
Thanks For the reply.
But How It work for non Indian employee.
For EX- I am from India If we use combination filter it work for myself. but user is non Indian then activity is not trigger for them.
My use case is like same activity set should trigger on normal user , but if user is from India then it should trigger one day before.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 12:31 AM
@Rameshwar Bera3 Select trigger type as "Advanced" and add below code in script section
Replace "parentCase.subject_person.country.name" with your instance country field of user table.
Replace "parent.u_expected_start_date" with Expected start date field of your instance.
(function shouldActivitySetTrigger(parentCase /* GlideRecord for parent case */ ,
hrTriggerUtil /* hr_TriggerUtil script include instance */ ) {
//for Non India User
var flag = false;
var todayDate = new GlideDate();
var expectedStartDate = new GlideDate();
expectedStartDate.setValue(parent.u_expected_start_date);
if (parentCase.subject_person.country.name != 'India' && (todayDate.getValue() == expectedStartDate.getValue()))
flag = true;
// for India User
var expectedStartDateFromParent = new GlideDateTime(parent.u_expected_start_date);
expectedStartDateFromParent.addDaysLocalTime(-1); // subtracting one day from expected start date
var expectedStartDateIndia = new GlideDate();
expectedStartDateIndia.setValue(expectedStartDateFromParent.getDate());
if (parentCase.subject_person.country.name == 'India' && (todayDate.getValue() == expectedStartDateIndia.getValue()))
flag = true;
return flag;
})(parentCase, hrTriggerUtil);
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!