November 25, 201015 yr Name: Sort Records by Calculation Type: Script Step Parameters: fieldNameList [ValueList], sortOrderList [ValueList] These are both set by specify calculation dialog boxes. It is the users responsibility to make sure they balance - otherwise script step returns error ("invalid parameters" or some such). fieldNameList is a valueList of field names. sortOrderList is a valueList containing: ascending, descending OR 'valueList' for custom order. Behaviour: if ( ValueCount ( fieldNameList ) ≠ ValueCount ( sortOrderList ) ) then ERROR "invalid parameters" (as above) Perform sort with field order given in list, using sortOrder to determine individual field sort order. Example usage: Sort Records by Calculation ( "MonthsOverdue¶DueAmount" ; "Descending¶Descending" ) Workaround [Mac only]: Put it in a script wrapper with those two parameters. Have sort fields present on layout to enable use of following code within PerformAppleScript: "sort by { field "" & Substitute( $fieldnameValueList ; "¶" ; "", field "" ) & "" } in order { " & Substitute ( $sortorderValueList ; "¶" ; ", " ) & " }"
November 26, 201015 yr Instead of AppleScript, I suspect there's a way to kludge this using XML and Snapshot Link.
Create an account or sign in to comment