Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
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

setSortBy function is not working as expected at object function level

in Sales 3 comments

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

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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