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-23-2023 09:42 PM
Thank you very much.
Yes It work But In same life cycle event I have another activity set which is trigger after 45 days of Expected Star. For this one also I need to trigger activity set before one day for Indian user for another user it should trigger normally.
Ex- For Indian user it should trigger 44 days after and for other user it trigger normal
Thanks in Advance..!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2023 10:26 PM
Hello Thanks for the reply,
Yes, This works. but I have a question in Another activity Set which is triggered after 45 days of expected start. For this activity set also needs to trigger 1 day before for Indian users for another user it should as normal.
For ex- For This 45 Days activity set needs to trigger an activity set after 44 days for Indian users and other users activity sets trigger after 45 days. How we can include this condition in advanced Trigger Type.
Thanks in Advance..!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 02:36 AM
@Rameshwar Bera3 Use below code for your new requirement.
Please open new thread for your new question, so that it will help others to search properly when they get into same issue.
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
(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 GlideDateTime(parent.u_expected_start_date);
expectedStartDate.addDaysLocalTime(45);
var expectedStartDateNonIndia = new GlideDate();
expectedStartDateNonIndia.setValue(expectedStartDateNonIndia.getDate());
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(44); // 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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 11:09 PM
@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-30-2023 01:38 AM
@Rameshwar Bera3 If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!