diff --git a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js index b3b5019620eeb8f41f7fdf43f8769f9c275b2888..67d5159a7b988831992b8af18bbaad5ed190c03e 100644 --- a/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js +++ b/entity/CampaignParticipant_entity/recordcontainers/participantsdbrecordcontainer/conditionProcess.js @@ -4,6 +4,7 @@ import("system.vars"); var condition = newWhere() .andIfSet("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", "$param.CampaignId_param") - .andIfSet("CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID", "$param.CampaignStepId_param"); + .andIfSet("CAMPAIGNPARTICIPANT.CAMPAIGNSTEP_ID", "$param.CampaignStepId_param") + .andIfSet("CAMPAIGNPARTICIPANT.CONTACT_ID", "$param.ContactId_param"); result.string(condition.toString()); diff --git a/entity/Person_entity/grantDeleteProcess.js b/entity/Person_entity/grantDeleteProcess.js index 88573c89e81ef582b5950cb216a6449152212166..876b00bdb6a168033f3c0e5bfc587b8fff02a973 100644 --- a/entity/Person_entity/grantDeleteProcess.js +++ b/entity/Person_entity/grantDeleteProcess.js @@ -28,6 +28,8 @@ if(personCount == 1) .andNoEntityRows("Offer_entity", "ContactOffers", {ContactId_param : contactId}) //Offers .andNoEntityRows("Contract_entity", "Contracts", {ContactId_param : contactId}) //Contracts .andNoEntityRows("ObjectTree_entity", "TreeProvider", {ObjectIds_param : JSON.stringify([contactId, vars.get("$field.PERSON_ID")]), ObjectTypes_param : JSON.stringify([currentContext, "PrivatePerson"])}) + .andNoEntityRows("CampaignParticipant_entity", "CampaignParticipantsProvider", {ContactId_param : contactId}) + .andNoEntityRows("Order_entity", "OrderProvider", {ContactId_param : contactId}) .validate(); } else if (personCount == 0) //special case in QuickEntry where it should be possible to remove a new Person that is not saved in the db yet diff --git a/entity/Person_entity/recordcontainers/db/onDBDelete.js b/entity/Person_entity/recordcontainers/db/onDBDelete.js index aed5eceb442ba9c187b395da25f17467c8a8808b..56d4461823493222635f99ab42de361ec497f838 100644 --- a/entity/Person_entity/recordcontainers/db/onDBDelete.js +++ b/entity/Person_entity/recordcontainers/db/onDBDelete.js @@ -14,5 +14,9 @@ new AttributeRelationQuery(contactId, null, ContextUtils.getCurrentContextId()) newWhere("COMMUNICATION.CONTACT_ID", contactId).deleteData(); newWhere("ADDRESS.CONTACT_ID", contactId).deleteData(); newWhere("COMMRESTRICTION.CONTACT_ID", contactId).deleteData(); +newWhere("AB_APPOINTMENTLINK.OBJECT_TYPE", "Person") +.and("AB_APPOINTMENTLINK.OBJECT_ROWID", contactId).deleteData(); +newWhere("AB_ATTRIBUTERELATION.OBJECT_TYPE", "Person") +.and("AB_ATTRIBUTERELATION.OBJECT_ROWID", contactId).deleteData(); WorkflowSignalSender.deleted(); \ No newline at end of file