Query child records in groovy
Hello Team,
I've a requirement to loop through Bill lines and update Bill adjustment based on certain conditions
Pseudo Code
def vo = newView('SubscriptionProduct')
def view_Criteria = newViewCriteria(vo);
def view_criteria_row1 = view_Criteria.createRow();
def view_condition1 = view_criteria_row1.ensureCriteriaItem('Eligible_c');
view_condition1.setOperator('=');
view_condition1.setValue(l_flag);
view_Criteria.insertRow(view_criteria_row1)
vo.appendViewCriteria(view_
vo.executeQuery();
while (vo.hasNext())
{
def LineX = vo.next()
def BillLine = LineX.billLines
BillLine.reset()
def vc = null
vc = newViewCriteria(BillLine,"InterfacedFlag = 'N'")
//BillLine.setSortBy('BillingPeriod, asc')
def iter = BillLine.findRowsMatchingCriteria(vc,-1)
println("Estimated row count post BillLines is"+iter.getEstimatedRowCount())