Hi,
Could someone please help on the below with sample code,
Need to Auto Approve the Workitem after sending the reminders.
Using below logic, to send the reminders, working good. But after sending all those reminders, need to auto approve the workitem.
// First Reminder
ReminderConfig firstReminderConfig = new ReminderConfig();
firstReminderConfig.setEnabled(true);
int days = differenceOfDays - 21;
System.out.println("days value is ----->"+days);
long milliValue = days * 24L * 60 * 60 * 1000;
firstReminderConfig.setMillis(milliValue);
firstReminderConfig.setEmailTemplateName("Workitem Email template");
managerConfigs.add(firstReminderConfig);
//differenceOfDays is attribute used for calculate the end date and current date diff based, on selection on the form//
//Second Reminder
ReminderConfig secondReminderConfig = new ReminderConfig();
secondReminderConfig.setEnabled(true);
int days1 = differenceOfDays - 14;
long milliValue1 = days1 * 24L * 60 * 60 * 1000;
secondReminderConfig.setMillis(milliValue1);
secondReminderConfig.setEmailTemplateName("Workitem Email template");
managerConfigs.add(secondReminderConfig);
NotificationConfig notifConfig = new NotificationConfig();
notifConfig.setEnabled(true);
notifConfig.setRemindersEnabled(true);
notifConfig.setConfigs(managerConfigs);
item.setupNotificationConfig(context, null, notifConfig);
context.saveObject(item);
context.commitTransaction();
Thanks,