例: Formula property (ViewColumn - Java™)

次のエージェントは、ビューの列式の値を切り替えます。

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("By category");
      ViewColumn vc = view.getColumn(3);
      if (vc.isFormula()) {
        if (vc.getFormula().equals("@Created"))
          vc.setFormula("@Modified");
        else
          vc.setFormula("@Created");
      }
      System.out.println("Formula = " + vc.getFormula());
        
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}