AnsweredAssumed Answered

SORTING A NUMERIC FIELD AS TEXT

Question asked by juandent on Oct 29, 2015
Latest reply on Oct 29, 2015 by juandent

I have a portal which I want to sort by different fields depending on which column header is clicked by the user. I have set up the script to the buttons in the column headers to use this calculated field  (call it cSortAsc) :

 

----------------

Case (

 

g_SortDirection = "asc";

 

   Case (

        g_SortField = "LINE_DOLLARS"; LINE_DOLLARS;

        g_SertField = "LINE_CONCEPT"; LINE_CONCEPT;

        "A"

    );

"A")

 

---------------

 

Then in the portal setup I assign the sort order by cSortAsc and choose ascending. A similar calculated field called cSortDesc is defined similarly except for the matching case g_SortDirection = "desc", and is chosen as second sort field in the portal setup. When the g_SortField is a field other than LINE_DOLLARS and LINE_CONCEPT, then these calculated fields return a constant which effectively does not sort them at all.

 

The return type of these fields is Text.

 

 

Thanks,

Juan

Outcomes