diff --git a/process/IncomingCallExecutor_lib/process.js b/process/IncomingCallExecutor_lib/process.js index 6ba61f39cb5e73c4ea40f77e830cc0e2c5119da6..876bb084ac92bff28195ba4f3cb7dd53e986c430 100644 --- a/process/IncomingCallExecutor_lib/process.js +++ b/process/IncomingCallExecutor_lib/process.js @@ -408,6 +408,8 @@ IncomingCallExecutor._getContactsFromNumber = function(pNumber, pContactIds) .leftJoin("PERSON", "CONTACT.PERSON_ID = PERSON.PERSONID") .where("CONTACT.STATUS", $KeywordRegistry.contactStatus$active()) .and("CONTACT.CONTACTID", contactIds, SqlBuilder.IN()) + //order by import if more than one record would be returned to give a statement: the first created, active contact is used + .orderBy("CONTACT.DATE_NEW asc") .table(); //map to the result how the entities-methods would return it to have less effort later when the mentioned ticket is done