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.
- INSERT INTO __M_CustomField_Definitions (
- Id,
- Final_Subject,
- Final_Kind,
- Final_Parent_Type
- )
- VALUES (
- 'Legacy Originating Attorney',
- 'Legacy Originating Attorney',
- 'TextLine',
- '__M_Matters'
- )
- INSERT INTO __M_CustomField_Values (
- Id,
- Final_Parent_Id,
- Final_Parent_Type,
- Final_CustomFieldDefinition_Id,
- Final_Value
- )
- SELECT
- CONCAT( V1.Final_Matter_Id, ' --- Legacy Originating Attorney --- ', V2.Id),
- V1.Final_Matter_Id,
- '__M_Matters',
- 'Legacy Originating Attorney',
- CONCAT( V2.Final_FirstName, ' ', V2.Final_LastName)
- FROM
- __M_Matters_Participating_Entities V1,
- __M_Users V2
- WHERE 1=1
- AND V1.Final_Role = 'Originating Attorney'
- AND V1.Final_Participant_Type = '__M_Users'
- AND V1.Final_Participant_Id = V2.Id