I'd like to get the id of a new record inserted in the database from a dynamicForm, the saveData() method inserts it with success but somehow the data prop in the callback is a String and not a object.
addNewDynamicForm.saveData(function (dsResponse, data, dsRequest) {
var id = data.id; // this is undefined
});
here is the String inside data:
"//isc_RPCResponseStart-->[{affectedRows:1,data:{modifiedUser:30,createdUser:30,created:new Date(1466133145985),companyNonLocked:true,version:0,deleted:false,name:"test",modified:new Date(1466133145985),id:32},invalidateCache:false,isDSResponse:true,operationType:"add",queueStatus:0isc.logWarn("java.lang.OutOfMemoryError: Java heap space\n\tat java.util.Arrays.copyOf(Arrays.java:3332)\n\tat java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137)\n\tat java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121)\n\tat java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:421)\n\tat java.lang.StringBuffer.append(StringBuffer.java:272)\n\tat java.io.StringWriter.write(StringWriter.java:101)\n\tat com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1294)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:842)\n\tat com.isomorphic.js.JSTranslater.convertIterator(JSTranslater.java:1409)\n\tat com.isomorphic.js.JSTranslater.convertCollection(JSTranslater.java:1358)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:790)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:703)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:694)\n\tat com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1245)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:842)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:703)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:694)\n\tat com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1245)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:842)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:703)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:694)\n\tat com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1245)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:842)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:703)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:694)\n\tat com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1245)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:788)\n\tat com.isomorphic.js.JSTranslater.convertIterator(JSTranslater.java:1409)\n\tat com.isomorphic.js.JSTranslater.convertCollection(JSTranslater.java:1358)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:790)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:703)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:694)\n");"
addNewDynamicForm.saveData(function (dsResponse, data, dsRequest) {
var id = data.id; // this is undefined
});
here is the String inside data:
"//isc_RPCResponseStart-->[{affectedRows:1,data:{modifiedUser:30,createdUser:30,created:new Date(1466133145985),companyNonLocked:true,version:0,deleted:false,name:"test",modified:new Date(1466133145985),id:32},invalidateCache:false,isDSResponse:true,operationType:"add",queueStatus:0isc.logWarn("java.lang.OutOfMemoryError: Java heap space\n\tat java.util.Arrays.copyOf(Arrays.java:3332)\n\tat java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137)\n\tat java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121)\n\tat java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:421)\n\tat java.lang.StringBuffer.append(StringBuffer.java:272)\n\tat java.io.StringWriter.write(StringWriter.java:101)\n\tat com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1294)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:842)\n\tat com.isomorphic.js.JSTranslater.convertIterator(JSTranslater.java:1409)\n\tat com.isomorphic.js.JSTranslater.convertCollection(JSTranslater.java:1358)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:790)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:703)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:694)\n\tat com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1245)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:842)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:703)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:694)\n\tat com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1245)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:842)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:703)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:694)\n\tat com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1245)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:842)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:703)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:694)\n\tat com.isomorphic.js.JSTranslater.convertMap(JSTranslater.java:1245)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:788)\n\tat com.isomorphic.js.JSTranslater.convertIterator(JSTranslater.java:1409)\n\tat com.isomorphic.js.JSTranslater.convertCollection(JSTranslater.java:1358)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:790)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:703)\n\tat com.isomorphic.js.JSTranslater.convert(JSTranslater.java:694)\n");"
Comment