If a task is related to an archived matter, mark it as complete

If a task is related to an archived matter, mark it as complete

The following will mark all tasks that are related to a closed/archived matter as Complete. 

  1. --The client has a bunch of tasks related to archived matters.
  2. --These tasks are NOT follow-ups and they NEVER intend on completing them.
  3. --The client would like us to close them out.
  4. UPDATE
  5. __M_Tasks
  6. SET
  7. Final_Stage = 'Complete'
  8. FROM
  9. __M_Tasks V1,
  10. __M_Tasks_Related_Entities V2,
  11. __M_Matters V3
  12. WHERE 1=1
  13. AND V1.Id = V2.Final_TaskEntry_Id
  14. AND V2.Final_RelatedTo_Id = V3.Id
  15. AND V2.Final_RelatedTo_Type = '__M_Matters'
  16. AND V3.Final_Status = 'Archived'

    • Related Articles

    • Matter Participants: Data Cleanup

      Table Overview Matter Participants are contacts that are related to Matters. They exist in the table: __M_Matters_Participating_Entities They have three primary fields: Field Description Final_Matter_Id The Id of the Matter. Final_Participant_Type ...
    • 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 ...
    • Deduplicate Matter Participating Entities

      Some systems will have the same entity (contact, user, etc...) associated with a matter multiple times with exactly the same role. If the signature of the relationship is exactly the same, the following script will eliminate the duplicates. ...
    • Create Notes from Matter Descriptions

      Some platforms do not support matter descriptions. The following will transform a matter description into a matter note. --Transform Matter Descriptions to Matter Notes INSERT INTO __M_Common_Notes (Id, Final_Parent_Id, Final_Parent_Type, ...
    • 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 ...