You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

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())

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!