Skip to content
Snippets Groups Projects
conditionProcess.js 719 B
Newer Older
S.Listl's avatar
S.Listl committed
import("system.logging");
import("system.vars");
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"))
{
    var excludedContacts = JSON.parse(vars.getString("$param.ExcludedContactIds_param"));
    cond.andIn("CONTACT.CONTACTID", excludedContacts, undefined, true);
S.Listl's avatar
S.Listl committed
logging.log(cond.translate("1=1"))
//TODO: use a preparedCondition (.build instead of .translate) when available #1030812 #1034026
result.string(cond.translate("1 = 1"));