This script below will create dummy contacts where the Matter is assigned to a contact that no longer exists.
- --Some of the Matters are linked to contacts that no longer exist.
- --This will create dummy contacts from the missing links.
- INSERT INTO __M_Contacts (
- Id,
- Final_Kind,
- Final_FullName
- ) SELECT DISTINCT Final_ClientContact_Id,
- 'Company',
- CONCAT('Missing Contact --- ', Final_ClientContact_Id) FROM __M_Matters WHERE 1=1 AND Final_ClientContact_Id != '' --Remove this to create a contact for No Contacts AND Final_ClientContact_Id NOT IN (SELECT Id from __M_Contacts)