Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Multiple Sort on one button


robfoster
 Share

Recommended Posts

Hello all,

I am sure that this is a very simple task... But nothing I have tried in

ScriptMaker has produced the results desired. Which are, to have one button

perform an ascending sort on one click, then a descending sort on the next

click - and have them alternate if the user were to keep clicking the

button, the same way it does in "table" view.

 

Thanks in advance

r

Link to comment
Share on other sites

Set Variable [$$Mode, Case($$Mode="Ascending", "Descending", "Ascending")]

If [$$Mode=Ascending]

Sort [restore, no dialog ]

Else

Sort [restore, no dialog ]

End If

Link to comment
Share on other sites

That solution may be OK for one button in the file sorting by one field but you may need to consider extending the logic to allow for storage of sort orders for different fields in the same table and for different tables.

 

So you might consider scripting using script variables where the table name, field name and sort order are passed and stored in a global variable.

 

If the table is already sorted by the field passed, it would sort in the opposite order. Otherwise it sorts in ascending order.

 

And you would also need to check Get ( SortState ) to see whether the table was still sorted.

 

Not a simple script but would be very powerful. ;)

Link to comment
Share on other sites

Hi

Thanks for the script, ive tried to turn it into a script in scriptmaker,but its not having it ,am i going about this the wrong way?, i was hoping to copy and paste that into scriptmaker then assign it to a button, sorry to be a pain....

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use