JAVA/CORBA CLASSES


Examples: DateFmt property
This agent toggles the date format for a column.

import lotus.domino.*;

public class JavaAgent extends AgentBase {

 public void NotesMain() {

   try {
     Session session = getSession();
     AgentContext agentContext = session.getAgentContext();

     // (Your code goes here)
     Database db = agentContext.getCurrentDatabase();
     View view = db.getView("All Documents");
     ViewColumn vc = view.getColumn(1);
     if (vc.getDateFmt() == ViewColumn.FMT_MD)
       vc.setDateFmt(ViewColumn.FMT_YM);
     else if (vc.getDateFmt() == ViewColumn.FMT_YM)
       vc.setDateFmt(ViewColumn.FMT_Y4M);
     else if (vc.getDateFmt() == ViewColumn.FMT_Y4M)
       vc.setDateFmt(ViewColumn.FMT_YMD);
     else
       vc.setDateFmt(ViewColumn.FMT_MD);
       
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also