Wednesday, 1 June 2016

Dynamic View Criteria programatically

We can create ViewCriteria programatically at run time. For that we need to get the VO.

you can write below logic in AMImpl.

/*get view object */
ViewObject VO= this.findViewObject("EmployeeVO");
/* create VC */
ViewCriteria vc = VO.createViewCriteria();
ViewCriteriaRow vcRow = vc.createViewCriteriaRow();
/* Set attribute */
vcRow .setAttribute("EmployeeId", 20);
vc.addRow(vcRow);
VO.applyViewCriteria(vc);
VO.executeQuery();


1 comment: