queryMap = Map(); queryMap.put("select_query","select COUNT(id) from Participants where Training_Program=" + id); response = invokeurl [ type :POST parameters:queryMap.toString() connection:"crm_oauth_connection" ]; |
iterations = (response.getJSON("data").get(0).get("COUNT(id)") / 2000).ceil(); no_records_flag = false; if(iterations == 0) { no_records_flag = true; iterations = 1; } iterationString = "".leftPad(iterations).replaceAll(" ",",").toList().subList(0,iterations); for each iteration in iterationString { if(!no_records_flag) Handle the function code from previous post here. } |
Writer is a powerful online word processor, designed for collaborative work.