Display Record count using Groovy in OM Extension
Hi All,
Trying to display record count using PVO but facing errors, below is the script which we are using. Can any one suggest with correct script
Object getTaskNum_cnt(String TaskName)
{
int Task_cnt01 =0;
def taskPVO = context.getViewObject("oracle.apps.projects.foundation.projectDefinition.publicView.FinancialTaskPVO");
def vc = taskPVO.createViewCriteria();
def vcrow = vc.createViewCriteriaRow();
vcrow.setAttribute("TaskName", TaskName);
def rowset = taskPVO.findByViewCriteria(vc, -1);
def TaskNum = rowset.first();
while(rowset.hasNext())
{
Task_cnt01 = Task_cnt01+1;
}
return Task_cnt01;
}
Also tried to display direct count using rowset.count(); function.
Thanks in Advance.
Regards,
Jhansi