LassoScript Utility
Basics Browse Detail

-SortColumn

Tag Link -SortColumn Category Database
Type Command Source Available No
Support Synonym Version 3.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0, Lasso 3.x

Description

-SortColumn specifies the name of a field which should be used to sort the results that are returned from a database action. Synonym is -SortField.

Can be used in concert with a -SortOrder tag to sort the field in Ascending, Descending, or Custom (data source dependent) order. Multiple -SortColumn tags can be used for compound sorts.

Syntax

[Inline: -SortColumn='Field_Name', -SortOrder='Ascending'...]

<a href="default.lasso?-SortColumn=Field_Name&-SortOrder=Descending&...">Link</a>

<form action="default.lasso" method="POST">
  <input type="hidden" name="-SortColumn" value="Field_Name">
  <input type="hidden" name="-SortOrder" value="Custom">
  ...
</form>

Parameters

Required Parameters
Field_Name The name of the column by which the results should be sorted.

Examples

To sort the results of a database action:

Use the -SortColumn and -SortOrder command tags. The following example specifies a -Search action in [Inline] ... [/Inline] tags. The results are sorted in descending order by Last_Name.

[Inline: -Search,
    -Database='Contacts',
    -Table='People',
    -SortColumn='Last_Name',
    -SortOrder='descending',
    'First_Name'='John']
  [Records]
    <br>[Field: 'First_Name'] [Field: 'Last_Name']
  [/Records]
[/Inline]

<br>John Surname
<br>John Doe