Clarity

  • 1.  “Copy Task from Template” history

    Posted May 11, 2017 02:28 PM

    Hi,

    We copy tasks from a template by function “Copy task from Template” on the Task TAB. I would like to find which task/project was my task copied from.

    Something like ODF_OBJECT_COPY_FLAT for functionality “Copy Project from Template” (https://communities.ca.com/thread/241733538).

    Did anybody see anything else than “project” in ODF_OBJECT_COPY_FLAT. OBJECT_CODE? (for example task etc.)

    Thanks,

    Karel



  • 2.  Re: “Copy Task from Template” history

    Posted May 11, 2017 04:43 PM

    That table does not seem to insert a record when Tasks are copied.

     

    But there is a column called PRMETHODEXTID on PRTASK, which is null if a Task is created manually, and has a value = PREXTERNALID if copied from a template. However, the description for this column reads, "Reserved for internal use only. A reference to the prExternalID column in the MRMethod table. This identifies the method from which a task is derived". So, any query making use of this column might not be 100% correct.. I have not tested it out thoroughly either..

     

    Having said that, the following query seems to fulfill the requirement of finding out the template from which a Task was copied, as far as I could quickly test.. You might have to test it further, and may be not rely on it completely..

     

    SELECT ii.name Template_Name,
      prt1.prname Template_Task_Name ,
      ii1.name CopiedTo_Project
    FROM prtask prt
    JOIN prtask prt1
    ON prt1.prexternalid = prt.prmethodextid
    JOIN inv_projects ip
    ON ip.prid         = prt1.prprojectid
    AND ip.is_template = 1
    JOIN inv_investments ii
    ON ii.id = ip.prid
    JOIN inv_investments ii1
    ON ii1.id = prt.prprojectid ;



  • 3.  Re: “Copy Task from Template” history

    Posted May 12, 2017 09:28 AM

    Hi Jeevan,

    Thanks for your answer - It looks promising!!

    There is a condition - You have to have the global defined unique Task ID otherwise you get many  templates to one task.

     

    Karel



  • 4.  Re: “Copy Task from Template” history

    Posted May 12, 2017 03:04 PM

    Hi Karel,

    Agree with that. If Task IDs are not unique, we only get a set of probable templates.