Stop or Resume an Assignment

Stop or Resume an Assignment

The ResourceAssignment class exposes properties for reading and writing an assignment’s stop and resume date:

To see an assignment’s stop and resume dates in Microsoft Project:

  1. On the Task Usage screen, select Insert and then Column.
  2. Add the desired columns.

Assignment stop and resume dates in Microsoft Project

checking resource assignments stop/resume dates in Microsoft Project 2013

Getting an Assignment’s Stop and Resume Dates using Aspose.Tasks

If an assignment hasn’t been stopped, the stop and resume dates have the value NA. In the evaluation version of Aspose.Tasks, values equal to NA gets the value “1/1/2000”. In the licensed version, NA values equal DateTime.MinValue.

In the following example, an assignment’s stop and resume dates are displayed in a console window after the code’s traversed the assignments in the project.

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(StopResumeAssignment.class);
 4
 5Project prj = new Project(dataDir + "project5.mpp");
 6
 7for (ResourceAssignment ra : prj.getResourceAssignments()) {
 8    if (ra.get(Asn.STOP).toString() == "1/1/2000")
 9        System.out.println("NA");
10    else
11        System.out.println(ra.get(Asn.STOP).toString());
12    if (ra.get(Asn.RESUME).toString() == "1/1/2000")
13        System.out.println("NA");
14    else
15        System.out.println(ra.get(Asn.RESUME).toString());
16}
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.