Create Contact Categories from Matter Participants

Create Contact Categories from Matter Participants



  1. --The following script will create Contact Categories from the roles
  2. --that Contacts are linked to on Matters and then assign the contacts to those categories.
  3. GO

  4. INSERT INTO __M_Contacts_Categories (
  5. Id, 
  6. Final_Subject
  7. )
  8. SELECT DISTINCT
  9. CONCAT('SYNTHESIZED --- ', Final_Participant_Role),
  10. Final_Participant_Role
  11. FROM
  12. __M_Matters_Participating_Entities
  13. WHERE 1=1
  14. AND Final_Participant_Type = '__M_Contacts'

  15. INSERT INTO __M_Contacts_Categories_Participating_Entities(
  16. Id,
  17. Final_ContactCategory_Id, 
  18. Final_Participant_Id, 
  19. Final_Participant_Type
  20. )
  21. SELECT DISTINCT
  22. CONCAT('SYNTHESIZED --- ', Final_Participant_Role, ' --- ', Final_Participant_Id),
  23. CONCAT('SYNTHESIZED --- ', Final_Participant_Role),
  24. Final_Participant_Id,
  25. Final_Participant_Type
  26. FROM
  27. __M_Matters_Participating_Entities
  28. WHERE 1=1
  29. AND Final_Participant_Type = '__M_Contacts'

  30. GO


    • Related Articles

    • Matter Participants: Data Cleanup

      Table Overview Matter Participants are contacts that are related to Matters. They exist in the table: __M_Matters_Participating_Entities They have three primary fields: Field Description Final_Matter_Id The Id of the Matter. Final_Participant_Type ...
    • Convert User-Select/Contact-Select Custom Fields => Participants

      Some systems do not support User-Select or Contact Select custom fields. The following query will transform User-Select fields into Matter Participants. This script can easily be adapted for Contact-Select fields. -- Transform Custom Fields on ...
    • Create a "Legacy Matter Number" Custom Field

      Some firms rely heavily on Matter Numbers to search for a specific matter. Sometimes when they migrate to a new system it can't replicate the automatic numbering system from their old system so they want to renumber all their matters to a new scheme ...
    • 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 ...
    • Create an "Employer" Contact from a Custom Field.

      In some systems, contacts do not have an Employer relation and only have a text field that represents the employer. This script will help when moving firms into platforms that allow an actual contact to be specified for the employer. --Create Company ...