Create and Apply View Criteria with IN Clause and Other Clause Dynamically in ADF

Get the View Object instance
           
            ViewCriteria vc = vo.createViewCriteria();
            vc.setName("INCriteria");
            String inClause = "IN (10,20,30,40)";
            ViewCriteriaRow criteriaRow = vc.createViewCriteriaRow();
            criteriaRow.setAttribute("DepatmentId", inClause);
            vc.addElement(criteriaRow);
            vo.applyViewCriteria(vc, true);
            vo.executeQuery();

If you want to add the view criteria with equal clause then use following lines of code :

                ViewCriteria vc = vo.createViewCriteria();
                ViewCriteriaRow criteriaRow = vc.createViewCriteriaRow();
                criteriaRow.setAttribute("DepatmentId",10);
                vc.addElement(criteriaRow);
                lovVO.applyViewCriteria(vc, true);
                lovVO.executeQuery();


Comments

Popular posts from this blog

Setting up the environment for Angular2 and Hello World Example in Angular2

Build a Simple ReactJS application using react-cli

Customizing the ReactJS sample application created using react-cli