Hi, can anyone tell me how I can change the order that Submitted form responses show up in the CMS?? (I just want them in descending order so that latest are at the top of the page...)
cheers
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi, can anyone tell me how I can change the order that Submitted form responses show up in the CMS?? (I just want them in descending order so that latest are at the top of the page...)
cheers
These instructions are based off userforms 0.2 but will probably work in 0.1 (with line numbers slightly diff
The function which returns the list of results is Submissions() in SubmittedFormReportField.php (line 20). Rather then just returning the values you will need to sort them then return them like this
function Submissions() {
$submissions = $this->form->getRecord()->Submissions();
if($submissions) $submissions->sort('Created', 'DESC'); // sort if they exist
return $submissions;
}
Great, thanks Will, thats it.