I am trying to return a map of object to sobject. However I get a parsing error:
VFRemote.js:117 Visualforce Remoting Exception: Error parsing json response:
'Unexpected token {'. Logged in?
I have no issues returning a map. That's what I find bizarre.
Has anyone returned a map of 2 objects before? Is the problem in my code?
EDIT
Here's my code:
Map<Contact, sObject__c> testMap = new Map<Contact, sObject__c>();
testMap.put(newContact, newsObject);
return testMap;
newContact and newsObject are created by me and inserted by me in the database. So on successful insert I populate the testMap with their values and try to return them.