In a test environment we have uploaded a large number of contacts. However now we need to delete them.
We want to delete approx half the contacts from the system and were planning on using a bulk delete job to this.
There is a chance that a contact record that we want to delete will have related records in other entities - for example custom entities.
If we delete a contact, using a bulk delete job - then will any records in other entities that are related to that contact record also get deleted ?
Are there any other issues that we need to worry about when using bulk delete to delete contacts ?
Thanks
As Dian stated you have to review the Cascade settings for the 1:N relationships for the entity you wish to delete. docs.microsoft.com/.../entity-relationship-behavior. Also note that some Cascade delete cannot be modified.
When you execute the delete job you will want to set the Dynamics instance into Admin mode as this will only allow Admins to log into the system. One more item to verify is that you have disabled any workflows and plugins that may execute an action when the Contact record is updated or deleted. This can cause performance issues and possible SQL timeouts.
Whether or not a related record will be deleted depends on the relationship. Parental relationships will delete the related tables. For example all activities related to the contact will be deleted. You can find the relationships for a table by opening the default solution file, expanding the table and viewing the 1:N relationships for that table. When you open a relationship, under relationship behavior you'll be able to see what happens when the parent record is deleted. In the screenshot below I created a custom 'Application' table. As you can see the 'Delete' option under Relationship behavior shows "Remove Link' which means the application record will not be deleted when the contact is deleted. The link to the contact lookup will be blank on the application record.
PLEASE MARK AS VERIFIED IF HELPFUL
Muhammad Shahzad Sh...
51
Most Valuable Professional
Ramesh Kumar
42
David Shaw_UK
27