LassoScript Utility
Basics Browse Detail

-SortOrder

Tag Link -SortOrder Category Database
Type Command Source Available No
Support Preferred Version 2.5
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, Lasso 2.5

Description

When specified after a -SortField or -SortColumn tag, -SortOrder specifies the order in which the field or column should be sorted. Possible values include Ascending or Descending to sort in alphabetical or numerical order and Custom to sort in a data source dependent order.

FileMaker Pro Note: Custom order can be used to sort a field in the order specified by a value list.

Syntax

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

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

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

Parameters

Required Parameters
SortOrder Ascending, Descending, Custom

Examples

To sort the results of a database action:

Use the -SortField 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',
    -SortField='Last_Name',
    -SortOrder='Descending',
    'First_Name'='John']
  [Records]
    <br>[Field: 'First_Name'] [Field: 'Last_Name']
  [/Records]
[/Inline]

<br>John Surname
<br>John Doe