To have sorted portals based on Calculation can never be fast, but are smart. Working with many records will make it a very slow user experience for your users.
The other choice is to have a Tab with a portal on each tab where you have sorted on the different fields. Then when you click on a label you just go to the tab where the portal is sorted on that label.
Portal is sorted on first label
Portal is sorted on second label
Then a button on each label going to Go to object
By date could be alpha- & chronological if you calculate your date to this "text" format:
yyyy-mm-dd // leading 0s
Amount would need a similar text conversion (padded with leading 0s?) How large is your largest amount?
Sent from miPhone
This is the better option!
Sent from miPhone
This is for a credit card reconciliation module. So thenmber of lines is less then a hundred but the amount can be large. Over 10K
With the global field method, the trick is to get all values to sort correctly as text. As beverly mentioned for dates.
Right ( "00000" & NumberField ; 5 ) will pad integers up to 99999 with leading zeroes so that they sort correctly as text. You'll need to consider trailing zeroes after the decimal as well if the amounts are not integers.
you can use an unstored calculation result type text with choose function and add 110000000000 to the numeric field and use getAsNumber to the Date field like:
choose ( global _index_sort_field ;
GetAsNumber ( TheDateField ) ;
110000000000 + TheAmountField )
then Set the global _index_sort_field to what needs to be sorted by.
wouldn't be handy to have
Sort Records by Field
work in Portals (and not just found set or records)?
1 of 1 people found this helpful
To sort any range of numbers, you can use 2 unstored calculation fields for number result and text result.
Case ( MiddleWords ( FieldType ( "" ; gSortF ) ; 2 ; 1 ) <> "text" ; Evaluate ( gSortF ) )
Case ( MiddleWords ( FieldType ( "" ; gSortF ) ; 2 ; 1 ) = "text" ; Evaluate ( gSortF ) )
then use both in portal sort.