id = null;
fromTime = now.toString("yyyy-MM-dd'T'HH:mm:ss+05:30");
toTime = now.subDay(10).toString("yyyy-MM-dd'T'HH:mm:ss+05:30");
queryMap = Map();
queryMap.put("select_query","select id from Leads where (((Email = '" + email + "') and (Account = '" + val + "')) and Created_Time between '" + toTime + "' and '" + fromTime + "') limit 1");
resp = invokeurl
[
url :"https:
type :POST
parameters:queryMap.toString()
connection:"crm2"
];
if(resp != null && resp.size() > 0)
{
id = resp.get("data").get(0).get("id");
}
return id;