AnsweredAssumed Answered

How to Sort Portal Rows (Ascending and Descending)

Question asked by DeShawnJackson on Feb 17, 2011
Latest reply on Jan 4, 2018 by hollsten

Title

How to Sort Portal Rows (Ascending and Descending)

Post

1. Create the following fields in your table:

g_Sort Asc (global text)

g_Sort Des (global text)

Sort Portal Asc (Calculation Text: GetField( g_Sort Asc )

Sort Portal Des (Calculation Text: GetField( g_Sort Des )

2. Create your portal table relationship (any relationship you need to make your portal)

Check "Sort Records" for the portal table

Select field Sort Portal Asc and check Sort Ascending

Select field Sort Portal Des and check Sort Descending

3. Create the following script: "Sort Portal"

If[ IsEmpty( g_Sort Asc ) ]

Set Field[ Sort Portal Asc; Value: Get ( ScriptParameter ) ]

Set Field[ g_Sort Des; Value: "" ]

Else

Set Field[ Sort Portal Des; Value: Get ( ScriptParameter ) ]

Set Field[ g_Sort Asc; Value: "" ]

End If

4. Create a button using the portal headers:

Right-click the header and select Button Setup

In the dialog, select Perform Script

Click Specify

Select the script Sort Portal and enter the field full name into the parameter box 

Example: If you are trying to sort the first name, and the field is Name_First, enter "Name_First" into the parameter box

Outcomes