Newer
Older
import("system.db");
import("system.result");
import("Sql_lib");
var cond = new SqlCondition();
cond.andPrepareVars("CONTACT.ORGANISATION_ID", "$param.OrgId_param")
.andPrepareVars("PERSON.CONTACT_ID", "$param.ContactId_param");
if (vars.exists("$param.ExcludedContactIds_param") && vars.get("$param.ExcludedContactIds_param"))
{

Johannes Hörmann
committed
var excludedContacts = JSON.parse(vars.getString("$param.ExcludedContactIds_param"));
cond.andIn("CONTACT.CONTACTID", excludedContacts, undefined, true);

Johannes Hörmann
committed
//TODO: use a preparedCondition (.build instead of .translate) when available #1030812 #1034026
result.string(cond.translate("1 = 1"));