Default End Date in Out of Office Assistant Task

Document ID : KB000014792
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

We are using the Out Of the Box functionality for Out Of Office, by use of Out Of Office Assistant Task where the initiator searches for some user whom he/she wants to put as his/her assistant during absence.

Question:

Is there a way we put some default end date in this task when a user does not specify anything as end date.

Answer:

Write a BLTH javascript for the "Out Of Office Assistant" task (Profile tab). 

Here is my sample setting the enddate as the current date + 7 days: 

 

function handleSetSubject(BlthContext, errorMessage) { 

importPackage(Packages.com.netegrity.ims.tabhandlers) ; 

importClass(Packages.java.util.Vector) ; 

importClass(Packages.java.util.Calendar) ; 

 

var vTabHandlers = BlthContext.getTaskTabHandlers() ; 

 

if (vTabHandlers != null) { 

for ( i = vTabHandlers.elements(); i.hasMoreElements();) { 

var e = i.nextElement() ; 

var cal = Calendar.getInstance(); 

cal.add(Calendar.DATE, 7); 

e.setEndDate(cal.getTime()); 

return true;