Create Contact Categories from Matter Participants
- --The following script will create Contact Categories from the roles
- --that Contacts are linked to on Matters and then assign the contacts to those categories.
- GO
- INSERT INTO __M_Contacts_Categories (
- Id,
- Final_Subject
- )
- SELECT DISTINCT
- CONCAT('SYNTHESIZED --- ', Final_Participant_Role),
- Final_Participant_Role
- FROM
- __M_Matters_Participating_Entities
- WHERE 1=1
- AND Final_Participant_Type = '__M_Contacts'
- INSERT INTO __M_Contacts_Categories_Participating_Entities(
- Id,
- Final_ContactCategory_Id,
- Final_Participant_Id,
- Final_Participant_Type
- )
- SELECT DISTINCT
- CONCAT('SYNTHESIZED --- ', Final_Participant_Role, ' --- ', Final_Participant_Id),
- CONCAT('SYNTHESIZED --- ', Final_Participant_Role),
- Final_Participant_Id,
- Final_Participant_Type
- FROM
- __M_Matters_Participating_Entities
- WHERE 1=1
- AND Final_Participant_Type = '__M_Contacts'
- GO