Create a "Legacy Matter Number" Custom Field

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 that the new system CAN support.  However, they may also want to preserve the old matter numbers so they can search for matters using those numbers.

The script below will create a custom field named 'Legacy Matter Number' and populate it with the matter numbers from their source system.

  1. INSERT INTO __M_CustomField_Definitions (
  2. Id,
  3. Final_Kind,
  4. Final_Subject,
  5. Final_Parent_Type
  6. )
  7. VALUES (
  8. 'Legacy Matter Number',
  9. 'TextLine',
  10. 'Legacy Matter Number',
  11. '__M_Matters'
  12. )

  13. INSERT INTO __M_CustomField_Values (
  14. Id,
  15. Final_Parent_Id,
  16. Final_Parent_Type,
  17. Final_CustomFieldDefinition_Id,
  18. Final_Value
  19. )
  20. SELECT
  21. CONCAT('Legacy Matter Number --- ', Id),
  22. Id,
  23. '__M_Matters',
  24. 'Legacy Matter Number',
  25. Final_ReferenceCode
  26. FROM
  27. __M_Matters
  28. WHERE 1=1
  29. AND LEN( Final_ReferenceCode ) > 0




    • 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 ...
    • Custom Fields: Creating Custom Fields via Queries

      Sometimes you may need to create a new custom field to handle an unmapped column in a database. The queries below will help you do that. -- This is the ID we are giving our custom field definition. DECLARE @FieldId NVARCHAR(MAX) = 'ConNo --- CUSTOM' ...
    • 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 ...
    • 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 ...
    • Flatten Custom Object fields into Contact/Matter Fields

      WARNING: Many systems that support custom objects allow multiple rows in custom objects. Many systems that allow custom fields only allow one single value for each field. When you use this script, if a matter has two values set for the same custom ...