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

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 want to maintain a record of who the Originating and Responsible Attorneys were.  You can accomplish this by creating custom fields to store those names.

The script below will synthesize and populate these two custom fields.

  1. INSERT INTO __M_CustomField_Definitions (
  2. Id,
  3. Final_Subject,
  4. Final_Kind,
  5. Final_Parent_Type
  6. )
  7. VALUES (
  8. 'Legacy Originating Attorney',
  9. 'Legacy Originating Attorney',
  10. 'TextLine',
  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( V1.Final_Matter_Id, ' --- Legacy Originating Attorney --- ', V2.Id),
  22. V1.Final_Matter_Id,
  23. '__M_Matters',
  24. 'Legacy Originating Attorney',
  25. CONCAT( V2.Final_FirstName, ' ', V2.Final_LastName)
  26. FROM
  27. __M_Matters_Participating_Entities V1,
  28. __M_Users V2
  29. WHERE 1=1
  30. AND V1.Final_Role = 'Originating Attorney'
  31. AND V1.Final_Participant_Type = '__M_Users'
  32. AND V1.Final_Participant_Id = V2.Id