Skip to content
Snippets Groups Projects
Commit dee0d8a7 authored by Johannes Goderbauer's avatar Johannes Goderbauer Committed by Benjamin Ulrich
Browse files

[Projekt: Entwicklung - Pool][TicketNr.: 1047128][Filter von Kontakt auf...

[Projekt: Entwicklung - Pool][TicketNr.: 1047128][Filter von Kontakt auf Firmenfelder funkioniert nicht]
# Conflicts:
#	entity/Person_entity/recordcontainers/db/recordfieldmappings/organisations/filterConditionProcess.js
parent 32bdb24c
No related branches found
No related tags found
No related merge requests found
import("system.vars");
import("system.result");
var sqlStr = "select PERSON_ID from CONTACT where ORGANISATION_ID in " +
" (select CONTACT.ORGANISATION_ID from CONTACT " +
" join ORGANISATION on (ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID) " +
" where PERSON_ID is null and " + vars.get("$local.condition") + ")" +
" and PERSON_ID is not null";
//it's necessary to join the organistion-contact since you may want to search for things like status, language, etc. from an organisation
var from = "CONTACT PersonContact\n\
join ORGANISATION on (ORGANISATION.ORGANISATIONID = PersonContact.ORGANISATION_ID)\n\
join CONTACT on (ORGANISATION.ORGANISATIONID = CONTACT.ORGANISATION_ID and CONTACT.PERSON_ID is null)";
result.string("PERSONID in (" + sqlStr + ")");
\ No newline at end of file
result.string("PERSONID in (select PersonContact.PERSON_ID from " + from + " where " + vars.get("$local.condition")+ ")");
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment