AnsweredAssumed Answered

Sorting records based on a variable field to be specified

Question asked by wladdy on Jul 21, 2014
Latest reply on Jan 4, 2018 by Siroos Jafary

Title

Sorting records based on a variable field to be specified

Post

     I need a script to perform a sort on a field which will vary depending on the active layout. For instance, if the layout is called "A", the sort field would be "Clients::Names", whereas if the layout is called "B", the sort field would be "Suppliers::Country".
      
     Right now, I can only think of using an If-Else construction, but surely there must be a better way...
      
     I can easily define in a variable (or in a global field) the name of the sort field. Could somehow use this variable to perform the sort...
      
     Many thanks! W. 

Outcomes