diff --git a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js index 5fdb3779fc2b8699a502c17353bbf34ff9a59bb1..cf6d64f699421bf5436f5e72b9c4d1d5d39c0a68 100644 --- a/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js +++ b/entity/VisitPlanEntry_entity/entityfields/entityactiongroup/children/newactivity/onActionProcess.js @@ -25,21 +25,8 @@ if(pointOfContact) links.push([ContactUtils.getContextByContactId(pointOfContact), pointOfContact]); else { - var contactId = vars.get("$field.ORGANISATION_CONTACT_ID"); - context = ContactUtils.getContextByContactId(contactId); - if(context == 'Person') - { - var orgContactId = newSelect("CONTACTID") - .from("CONTACT") - .where("PERSON_ID is null") - .and("CONTACT.ORGANISATION_ID", newSelect("ORGANISATION_ID") - .from("CONTACT") - .where("CONTACT.CONTACTID", contactId) - .cell()).cell(); - if(orgContactId) - links.push(["Organisation", orgContactId]); - } - links.push([context, contactId]); + links.push(["Organisation", vars.get("$field.ORGANISATION_CONTACT_ID")]); + links.push(["Person", vars.get("$field.CONTACT_ID")]); } ActivityUtils.createNewActivity(null, links, null, null, null, null, $KeywordRegistry.activityDirection$outgoing(), null, $KeywordRegistry.activityCategory$visit(), vars.get("$field.ENTRYDATE"), vars.get("$field.UID"));