I have a simple hierarchical outline code in Project, of the form
1
1.1
1.2
1.3
2
3
When I look at it in my .NET code, through Aspose.Tasks I would expect the ParentValueId of the three children nodes (1.1, 1.2, 1.3) to be equivalent to the ValueId of their parent (1) but that is not the case.
Using a simple loop to output the values:
Debug.WriteLine(“ValueId - Value - Description - ParentValueId”);
foreach(OutlineValue ov in Project.OutlineCodes.Last().Values) {
You are referring to wrong field for retrieving the required information. You actually need to retrieve the Outline Numbers information but are retrieving Outline codes. Please have a look at the following code sample for retrieving this information for a task.
Code:
Project project = new Project(“OutlineNumbers.mpp”);
I think you are misunderstanding my question. You are talking about the Outline Numbers that deal with the hierarchy of the TASKS in a schedule.
That is not what I want. I have a schedule that has a hierarchical code field. It is in Outline Code5. I want to retrieve the values for that code field, including its structure so that I can recreate in my product. (Picture attached of what I am talking about.)
My code successfully gets the Outline Code and I see all the values. The only thing wrong seems to be the parent id. I don’t understand why the ParentValueId of the three children is 1114114.
Following sample code displays the Outline codes’ ValueId, Value, Description and ParentValueID in a project. Aspose.Tasks for .NET 8.8.1 is used for this testing. Please give it a try and let us know the feedback.
I have logged the issue of incorrect ParentValueId values in MPP in our issue tracking system under Id: TASKS-34245 for further investigation by the product team. I shall write here as soon as some feedback is received in this regard.
While we await feedback on that issue I had another question…
Is there a method or property in the API that will give me the full name/path of an OutlineValue?
That is “1.1” for example.
I don’t see one. The only way I see to do it is to actually use the ParentValueID along with the the OutlineCodeDefinition.Masks to build it myself. But of course that won’t work until the ParentValueID issue is resolved. I was hoping there was already a way to get the full name/path for an OutlineValue.
I am sorry to share that I could not find any such method to retrieve this information as an alternate way to achieve the same. We shall update you here once we have information about the issue logged for this problem.
You can find the migration changes mentioned in our article, Migration to Aspose.Tasks for .NET 8.0.0 and higher. Following are the equivalents of your above requirements. Please have a look at these and let us know if we can be of additional help to you.
1. Yes, the ProjectReader calss is no more available and you can use the Project class constructor as you have mentioned.
2. There is only one Project.Recalculate method and all other calculations are carried on automatically.
Code Sample:
Task tsk = project.RootTask.Children.GetById(0);
//Project.GetResourceAssignmentsByTask
ResourceAssignment ra = tsk.Assignments.GetByUid(1);
//Project.RemoveResourceAssignment
ra.Delete();
//Project.RemoveLink
project.TaskLinks.Remove(sometaskLink);
//Project.RemoveTask
tsk.Delete();
//Task.Children.Clear() - No equivalent. Deleting a parent task deletes the children tasks
//Calendar.Days =>
Calendar.WeekDays;
//Calendar.WorkWeeks - This is no more supported in the revamped API
So does that mean there is no way to get the Work Week information for a calendar at all anymore? Any plans to add it back in? I mean Project still allows them to be defined so that seems odd to not give access to that information.
I have logged the requirement of reading Work Weeks from Calendar as Enhancement ticket under Id: TASKS-34382 in our issue tracking system for further investigation by the product team. I shall write here as soon as some feedback is received in this regard.
I have re-produced the issue here and logged it under Id: TASKS-34383 in our issue tracking system for further investigation by the product team. I shall write here as soon as some feedback is received in this regard.