Sorting records based on a variable field to be specified
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.