Monday, September 4, 2017

How To: Execute View Criteria programmatically

Consider the following view criteria is defined on a view object:




To execute this view criteria programmatically, write the following method in the AMImpl class:
    public void executeInvoiceVOCriteria(String invoiceNum, String poNum){
        ViewObjectImpl vo = getInvoiceVO1();        
        ViewCriteria vc = vo.getViewCriteria("InvoiceVOCriteria");
        vo.applyViewCriteria(vc);
        vo.setNamedWhereClauseParam("p_inv_num", invoiceNum);
        vo.setNamedWhereClauseParam("p_po_num", poNum);
        vo.executeQuery();
    }




Hope you find this helpful! Please share your feedback below.

CaptiveCode


No comments:

Post a Comment