Examples: SelectionFormula property (View - Java)

  1. This view action displays the selection formula for a view.
    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 = null;
          view = db.getView("Special View");
          System.out.println(view.getSelectionFormula());
    
        } catch(Exception e) {
          e.printStackTrace();
        }
      }
    }
  2. This view action sets the selection formula for a view.
    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 = null;
          view = db.getView("Special View");
          view.setSelectionFormula(
            "@Now < @Adjust(@modified; 0; 0; 6; 0; 0; 0)");
    
        } catch(Exception e) {
          e.printStackTrace();
        }
      }
    }