I have used the tutorial for V4 and got the database working well, the tutorial for multi record loading. Now that I am getting a few records, is that a line I can enter into the custom code section that will sort the results by a field (cf_id) in a descending order.
Cheers
Mick.
Cheers
Mick.
Hi Mick,
Please check the "Order Fields" field in the "Multi Record loader" action under the "Data displayer" tab.
Regards,
Max
Please check the "Order Fields" field in the "Multi Record loader" action under the "Data displayer" tab.
Regards,
Max
Hi Mick,
I don't think that you can specify ASC or DESC in the DB Multi-Record Loader (I just tried and nothing was ordered). If you aren't using the Data Displayer then you could use a custom Code action to reverse the order of the array. Or you could try adding an extra column to your table and set it to be the negative of the cf_id.
Later: I just looked at the code and there is a workaround.
First you must enable Pagination (I don't quite know why). Then use a Custom Code action before the DB Multi Record Loader and add code like this.
Bob
Later still: I added this FAQ
I don't think that you can specify ASC or DESC in the DB Multi-Record Loader (I just tried and nothing was ordered). If you aren't using the Data Displayer then you could use a custom Code action to reverse the order of the array. Or you could try adding an extra column to your table and set it to be the negative of the cf_id.
Later: I just looked at the code and there is a workaround.
First you must enable Pagination (I don't quite know why). Then use a Custom Code action before the DB Multi Record Loader and add code like this.
<?php
if ( !isset($form->data['order']) || !$form->data['order'] ) {
$form->data['order'] = 'cf_id';
if ( !isset($form->data['direction']) || !$form->data['direction'] ) {
$form->data['direction'] = 'DESC';
}
}
?>
Bob
Later still: I added this FAQ
This topic is locked and no more replies can be posted.