setSortBy function is not working as expected at object function level
Summary:
We used the setSortBy() function in object function to sort the data of child object, but that data is not coming in sorting sequence. Always it's considering the first created record in first place and second record onwards it's giving sorting data. And same script is working as expected at trigger level. Any one has one idea on this?
Content (please ensure you mask any confidential information):
this is my code to sort data
def Child= newView('DebriefLine_c')
Child.appendViewCriteria("Debrief_Id_c='${Id}'")
Child.setSortBy('LineNo_c asc')
Child.executeQuery()
println("count:"+Child.getEstimatedRowCount());while(Child.hasNext()){def row=Child.next();