Moving Documents into Matters that are Nested under Tasks
- --The following script moves documents that are nested under Tasks to be nested under Matters instead.
- UPDATE
- __M_Documents_Digital_Files
- SET
- Final_Folder_RelativePath = '\Task Attachments\',
- Final_Parent_Type = Relationships.Final_RelatedTo_Type,
- Final_Parent_Id = Relationships.Final_RelatedTo_Id
- FROM
- __M_Documents_Digital_Files Documents,
- __M_Tasks Parents,
- __M_Tasks_Related_Entities Relationships
- WHERE 1=1
- AND Documents.Final_Parent_Type = '__M_Tasks'
- AND Documents.Final_Parent_Id = Parents.Id
- AND Parents.Id = Relationships.Final_TaskEntry_Id
- AND Relationships.Final_RelatedTo_Type = '__M_Matters'