From 337a664864d8d3913f579cc2cbe026cf2d557bb6 Mon Sep 17 00:00:00 2001 From: Ryan Fritts Date: Wed, 14 Aug 2013 10:11:37 -0500 Subject: [PATCH] Update search to better align with REST API REST API returns JSON Serialized List, current RemoteTK controller serializes List>, which is the default return of a SOSL query - this better aligns the RemoteTK implementation with the ForceTK REST API implementation for better interoperability and interchangability. --- RemoteTKController.cls | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RemoteTKController.cls b/RemoteTKController.cls index 859cd3a..6c0661f 100644 --- a/RemoteTKController.cls +++ b/RemoteTKController.cls @@ -280,9 +280,11 @@ public class RemoteTKController { @remoteAction public static String search(String sosl) { - List> result; + List result = new List(); try { - result = Search.query(sosl); + List> searchResults = Search.query(sosl); + for(List sr : searchResults) + result.addAll(sr); } catch (QueryException qe) { return makeError(qe.getMessage(), 'INVALID_SEARCH'); } catch (SearchException se) {