I have created saved search to group by pay code type and sum amount.
Pay code : Sequence--> Group, Amount--> Sum
Sort by Pay code : Sequence ASC
when I export this search to script and run, i am getting following error.
{"type":"error.SuiteScriptError","name":"INVALID_SUMMARY_SRCH","message":"In a summary search, you must sort by a result field with a summary function. Please go back and correct the sort by field on the results tab.","stack":["createError(N/error)","getEmployeeAmountTotals(/SuiteScripts/suitelet_transfer_funds_screen.js:160)","onRequest(/SuiteScripts/suitelet_transfer_funds_screen.js:185)"],"cause":{"type":"internal error","code":"INVALID_SUMMARY_SRCH","details":"In a summary search, you must sort by a result field with a summary function. Please go back and correct the sort by field on the results tab.","userEvent":null,"stackTrace":["createError(N/error)","getEmployeeAmountTotals(/SuiteScripts/suitelet_transfer_funds_screen.js:160)","onRequest(/SuiteScripts/suitelet_transfer_funds_screen.js:185)"],"notifyOff":false},"id":"","notifyOff":false,"userFacing":false}
Whats wrong here? Please Help!