Examples: IsSorted property (ViewColumn - Java)

This agent toggles whether the first column in a view is auto-sorted.

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.isSorted())
        vc.setSorted(false);
      else
        vc.setSorted(true);
      System.out.println("IsSorted = " + vc.isSorted());
        
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}