Synthesize Missing Client Contacts for Matters
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)
Related Articles
Synthesize Missing Matters for Documents
Some systems only allow documents to be linked to matters. These scripts will allow you to restore data into these systems. When Matters No Longer Exist The following script with synthesize matters for document related to matters that no longer ...
Synthesize Missing Practice Areas
The following SQL script will create practice areas where they do not exist in the Matters table. --Synthesize missing practice areas from Matters INSERT INTO __M_Matters_PracticeAreas( Id, Final_Subject ) SELECT DISTINCT Final_PracticeArea_Id, ...
Matters: Prepending Client Names to Matters
The following script will prepend Client Names to Matter Names. For Example: Divorce 2016 would become John Smith --- Divorce 2016 Here is the relevant script: --Prepend all matter descriptions with the client name. UPDATE __M_Matters SET ...
Matters: Trimming Client Numbers from Matter Numbers
The following script will peel off client numbers from matter numbers. For example, if a matter has a ReferenceCode like: ABC-0001 After the script runs, it will have a reference code of: 0001 Scenario 1: There are Client Reference Codes In some ...
Synthesize: Missing Document Categories for Documents
The following script will synthesize document categories for invalid Final_DocumentCategory_Id values on documents. -- Some documents are linked to categories that no longer exist. -- Create dummy document categories based on these values. INSERT ...