Copy User and Contact Picklists from __M_CustomField_Definitions to __M_Matters_Participating_Entities

Copy User and Contact Picklists from __M_CustomField_Definitions to __M_Matters_Participating_Entities

Some systems do not support custom fields that are User/Contact Picklist but they do support participants.

Use this script to copy custom field values/definitions into the Matter Participants table.

  1. --We need to copy some records from custom fields into matter participants.
  2. INSERT INTO __M_Matters_Participating_Entities (
  3.     Id,
  4.     Final_Matter_Id,
  5.     Final_Participant_Type,
  6.     Final_Participant_Id,
  7.     Final_Role
  8. )

  9. SELECT
  10.     CONCAT(V1.Id, V2.Id),
  11.     V2.Final_Parent_Id,
  12.     V1.Final_Kind,
  13.     V2.Final_Value,
  14.     V1.Final_Subject
  15. FROM
  16.     __M_CustomField_Definitions V1,
  17.     __M_CustomField_Values V2
  18. WHERE 1=1
  19.     --Do the conversion for custom fields that are Contact or User picklists
  20. --If you only want Users, then adjust the following.
  21.     AND V1.Final_Kind IN ('__M_Contacts', '__M_Users')
  22.     --And extend the Matters table.
  23.     AND V1.Final_Parent_Type IN ('__M_Matters')
  24.     AND V2.Final_CustomFieldDefinition_Id = V1.Id

    • Related Articles

    • Create a "Legacy Originating Attorney" field (from __M_Matters_Participating_Entities)

      Most destination systems will only let you set the Originating Attorney and Responsible Attorney to an active user. This is why user mapping is used to map inactive users from the legacy system to an active user in the new system. But the firm may ...
    • 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 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 ...
    • Copy a Custom Field into a Core Field

      Some systems don't have certain core fields and clients often create a custom field that they use instead. The following script will let you copy values from a custom field named 'Opened' into __M_Matters.Final_Date_Opened . You can adjust this ...
    • Copy Calendar Entry Dates into Custom Field Values

      Some systems let you create custom fields that reference a Calendar Entry. When moving custom fields into a system that does not support this, an easy workaround would be to turn these custom fields into DateTime custom fields by copying in the start ...