Open 1Androider opened 7 years ago
`JSONObject mJsonObject=new JSONObject(); mJsonObject.put("body", body); mJsonObject.put("subject", subject); mJsonObject.put("partner_ids", ContactIDs); OArguments args = new OArguments(); args.add(mJsonObject);
double newId=(Double) mModel.getServerDataHelper().callMethod("create", args, null, data1); Thread.sleep(500);
// successfully get newid and pass this newid to send_mail
ArrayList mMsgId=new ArrayList<>(); mMsgId.add((int)newId); OArguments args1 = new OArguments(); args1.add(mMsgId);
double newId1=(Double)mModel.getServerDataHelper().callMethod("send_mail", args1, null, null);
` getting error like: dictionary update sequence element #0 has length 1; 2 is required
for reference .callmethod syntax is : public Object callMethod(String method, OArguments args, HashMap<String, Object> context, HashMap<String, Object> kwargs) { return callMethod(mModel.getModelName(), method, args, context, kwargs); }
public Object callMethod(String method, OArguments args, HashMap<String, Object> context, HashMap<String, Object> kwargs) { return callMethod(mModel.getModelName(), method, args, context, kwargs); }
Please help to resolve this issue
`JSONObject mJsonObject=new JSONObject(); mJsonObject.put("body", body); mJsonObject.put("subject", subject); mJsonObject.put("partner_ids", ContactIDs); OArguments args = new OArguments(); args.add(mJsonObject);
double newId=(Double) mModel.getServerDataHelper().callMethod("create", args, null, data1); Thread.sleep(500);
// successfully get newid and pass this newid to send_mail
ArrayList mMsgId=new ArrayList<>();
mMsgId.add((int)newId);
OArguments args1 = new OArguments();
args1.add(mMsgId);
double newId1=(Double)mModel.getServerDataHelper().callMethod("send_mail", args1, null, null);
` getting error like: dictionary update sequence element #0 has length 1; 2 is required
for reference .callmethod syntax is :
public Object callMethod(String method, OArguments args, HashMap<String, Object> context, HashMap<String, Object> kwargs) { return callMethod(mModel.getModelName(), method, args, context, kwargs); }
Please help to resolve this issue