Identify Cross Project Tasks
Contents
[
Hide
Show
]How to Identify Cross Project Tasks
If you have linked a task from one project to a task from the other project, the IDs and UIDs of the task is different in the original and external projects as you can see in the following image:
The ExternalId property exposed by the Task class is used to find an external task’s original ID. The Id property returns the ID of the external task in the external project whereas the ExternalId property returns the ID of the external task in the original project.
The code below finds the original and external ID of a task.
1Project project = new Project("New Project.mpp");
2Task task = project.RootTask.Children.GetByUid(1);
3
4// Show ID of the task in the external project
5Console.WriteLine(task.Get(Tsk.Id).ToString());
6
7// Show ID of the task in the original project
8Console.WriteLine(task.Get(Tsk.ExternalId).ToString());