Wednesday 15 August 2018

How to loop through vo in oaf

How to loop through vo in oaf

In this post , we will discuss how we can create loop in the View object (VO) extraction to shows its data one by one in the OAF page. Here you will find the sample code for How to loop through vo in oaf. View object (VO) extracts the data from the database in the Oaf page and we need to read this extraction to do comparison and put conditions based on this data extraction to write our custom code.This sample code will help to show all the data of the view object sequentially and we can do calculations and comparisons based on the extractions. 
 

Sample code for How to loop through vo in oaf

 
OAViewObject SupsVO = (OAViewObject)am.findViewObject(""XXSupLovVO1"");


        if (SupsVO  != null)
        //Check for null
              SupsVO.reset();
         //It will take you to the first row of Vo


        while ( SupsVO.hasNext())
        {
        XXXRowImpl currow = (xxxVORowImpl)SupsVO .next();
        //it will return a rows in a order
        //now we can use currow.getAttributes,currow.setAttributes
         //for implementing our logic as shown below
         string firstAttr = currow.getAttribute("Attr1");

         string SecondAttr =emacurrow.getAttributes("Attr2));

        }

0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *