none
How to indent a task programmatically? RRS feed

  • Question

  • Hi,

    Is it possible to indent a task in a task list programmatically? It does not seem to be working if I set ParentID field.

    Thanks!

    Thursday, March 9, 2017 4:42 PM

Answers

  • Hi,

    I use a code like this to indent a task:

    The id of the parent task is “1”, so I set the value of the “ParentID” as “1;#1”.

    Please take it for a try in your environment and let me know if it can work for you.

    Best regards,

    Patrick

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by diffident Monday, March 13, 2017 2:14 PM
    Friday, March 10, 2017 2:43 AM
    Moderator
  • Hi,

    Both are the "ID" of the parent task, something like "<Parent Task ID>;#<Parent Task ID>".

    Best regards,

    Patrick


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by diffident Monday, March 13, 2017 2:12 PM
    Monday, March 13, 2017 7:43 AM
    Moderator

All replies

  • Hi,

    I use a code like this to indent a task:

    The id of the parent task is “1”, so I set the value of the “ParentID” as “1;#1”.

    Please take it for a try in your environment and let me know if it can work for you.

    Best regards,

    Patrick

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by diffident Monday, March 13, 2017 2:14 PM
    Friday, March 10, 2017 2:43 AM
    Moderator
  • Thanks, Patrick, much appreciated. In the string "1;#1", do both the 1's represent Parent task's ID or is the second 1 just the order of the subtask? I am confused.
    Friday, March 10, 2017 4:33 PM
  • Hi,

    Both are the "ID" of the parent task, something like "<Parent Task ID>;#<Parent Task ID>".

    Best regards,

    Patrick


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by diffident Monday, March 13, 2017 2:12 PM
    Monday, March 13, 2017 7:43 AM
    Moderator