AnsweredAssumed Answered

Sorting a portal ascending or descending with a button

Question asked by jdevans on May 16, 2018
Latest reply on May 16, 2018 by jdevans

I have a portal on a layout that has a LOT of complicated scripts tied to it and so the option of making a copy of it and placing it on a tab control isn't practical in my case. So, I'd like to be able to sort based on a global field as some have mentioned in other Portal Sorting questions.
However, when I've attempted to do it, I still get stuck at how to actually set it up using the dialog boxes FileMaker Pro Adv provides.

Here's what I understand...

1) create an unstored calculated field in same TO as the portal data that will have as its calculated value the List of values that the portal will sort on.

2) set a global field to that on button click using a script.

3) sort the portal by that global field.

 

HOWEVER, in my case the calculated field is just a list of numbers 1-N. I can set it either sorted 1-N or N-1.
I can also set the global field to that value list without a problem.

I can't figure out how to get the portal to sort using that list whether ascending or descending.

It seems I can't get past the Sort Portal dialog box and the choices it gives me.Capture.PNG

If I select a global_field from the TO on which my portal is based, then I'm forced to select
   a) Ascending

   b) Descending

   c) Custom order based on a value list.

 

I assume that when people on this forum have given instructions to other people with similar questions, they mean to use this dialog to set up the sort.
So to my thinking, the only option that makes sense is to select "Custom order based on value list".

If that's correct, then the next thing I have to do is to select a value list, which hasn't been set up yet.
If that's not correct, then if I select Ascending or Descending, regardless of how my global field is sorted, the Ascending or Descending option is going to over-ride it?

 

I'm lost at this last, most crucial part of portal sorting using the method that keeps showing up in my Forum searches, simply because it hasn't been fully explained.

Outcomes