none
How to set task start date and finish date in XML for Microsoft Project RRS feed

  • Question

  • The program that I am currently working on has starting dates and finishing dates for different tasks and I need to be able to export these dates into XML so then it can be imported into MS Project.

    The problem is that the Manual finish date isn't being imported into MS Project and I end up with the correct manual start date but zero duration. It is doable by specifying remaining duration but it's a bad idea to make it depend on the working schedule and I would like to import tasks correctly with just a start date and an end date.

    My question is how to create an XML format that can be imported into MS Project with the correct start date and end date?

    Here is a sample XML segment:

    <Task>
     <UID>2</UID>
     <ID>2</ID>
     <Name>task1.1</Name>
     <Active>1</Active>
     <Manual>1</Manual>
     <OutlineNumber>1.1</OutlineNumber>
     <OutlineLevel>2</OutlineLevel>
     <ManualStart>2019-03-20</ManualStart>
     <ManualFinish>2019-03-26</ManualFinish>
     <DurationFormat>7</DurationFormat> 
     <FreeformDurationFormat>7</FreeformDurationFormat>
    </Task>

    When this is imported, the task would start on 03-20 but also finish on 03-20 with zero duration. 

    Thanks for you help.


    • Edited by yinmax Wednesday, April 3, 2019 3:25 PM <Finish> was supposed to be <ManualFinish>
    Tuesday, April 2, 2019 10:46 PM

All replies

  • yinmax,

    I've never tried creating an XML document directly and then importing it into Project but I did do a quick test with a simple Project file with two manually scheduled tasks and saved that as XML.

    As I suspected, for a manual task you need to specify both a manual start AND a manual finish. As reference, this is a part of what appears in the XML file.

    <Task>
                <UID>1</UID>
                <GUID>E23B2BE0-C73B-4A23-A35C-C2A57E707DAA</GUID>
                <ID>1</ID>
                <Name>task a</Name>
                <Active>1</Active>
                <Manual>1</Manual>
                <Type>2</Type>
                <IsNull>0</IsNull>
                <CreateDate>2019-04-02T18:57:00</CreateDate>
                <WBS>1</WBS>
                <OutlineNumber>1</OutlineNumber>
                <OutlineLevel>1</OutlineLevel>
                <Priority>500</Priority>
                <Start>2019-04-02T08:00:00</Start>
                <Finish>2019-04-05T17:00:00</Finish>
                <Duration>PT32H0M0S</Duration>
                <ManualStart>2019-04-02T08:00:00</ManualStart>
                <ManualFinish>2019-04-05T17:00:00</ManualFinish>
                <ManualDuration>PT32H0M0S</ManualDuration>
                <DurationFormat>21</DurationFormat>

    Hope this helps.

    John


    • Edited by John - Project Wednesday, April 3, 2019 2:10 AM wrong snippet
    Wednesday, April 3, 2019 2:06 AM
  • Sorry I have made a mistake in my sample code the <Finish> tag is supposed to be <ManualFinish>, it will be edited.

    But the problem is that even when I specify a ManualStart and a ManualFinish, the ManualFinish would still not be imported correctly and the task will be imported with a duration of 0 that has Start and Finish date on the same day.

    The only way that I was able to import a task with some duration is through setting the <RemainingDuration> tag (ie. PT40H0M0S), and instead of depending on duration to Import tasks I would prefer to just import using the actual start/finish dates.

    Thanks for the help.

    Wednesday, April 3, 2019 3:25 PM
  • yinmax,

    I've played around with the XML format for more time than I should and I'm sorry to say that at this point I don't have an answer. Two tasks that I have coded in XML are identical (as far as I can tell) except for the start and finish dates, one imports with the desired duration and the other imports with a one day duration.

    I'll have to leave this investigation up to you unless someone else steps in with an answer.

    Sorry,

    John

    Wednesday, April 3, 2019 5:53 PM