Scenario: I want to get the total number of records from a query run object. I will use them to generate a progress bar (progress indication framework).
Answer: Use SysQuery::countloop(qr). this will return the total number of records in a query object.
Very usefull, i used it in my feature and it works!! :)
ReplyDeleteJust be very careful, when you have QueryRun with more then one dataSource. In this case this method will count records really uneffective, he will move trough whole QueryRun one by one.
ReplyDeleteRegards
I think the correct method to get the number of records is SysQuery::countTotal().
ReplyDelete