How to get total count of records with query result?
ankitpatelinitio opened this issue · 1 comments
ankitpatelinitio commented
How to get a total count of records with query result because I have to implement pagination with the use of total count of records.
Thanks
mrbarletta commented
Hi @ankitpatelinitio - currently there is no metadata returned for the query.
I will add this soon as this is available in the function we use to create the listing. SuiteCRM-link
$response['row_count'] = $rows_found;
$response['next_offset'] = $next_offset;
$response['previous_offset'] = $previous_offset;
$response['current_offset'] = $row_offset;
What we do is to use limit
clause to a higher number than the config (usually set to 20) and then check if the query count matches limit
if it does, I do another query with offset clause.