Task Extended Attributes Not Being Saved to MS Project

Hi,



Not sure if the problem I have is related to: TAKSS-34560 (Extended Attribute not being saved with new document)



When I debug my code, I can see ExtendedAttribute being added to the Task, but When I opened the MPP project in MS 2013, only unique values are being displayed in the custom fields. See attached code and result.



Thanks.

Cole

Hi Cole,

Thank you for writing to Aspose support team.

TASKS-34560 is still pending for resolution as our Product team is working on it.

I have tried to compile the sample code but could not resolve TscpReportItem. Could you please send us a complete test project which can be compiled and executed here to re-produce the scenario? A working project will be a great help to observe the issue and provide assistance at the earliest.

Please see new attachements to reproduce the issue.



Thanks.

Cole

Hi Cole,

Thank you for sharing additional files. We’re currently investigating this issue at our end and will update you here with our feedback soon.

You guys are rock stars!!! It works great!

Now… I want to add a SECOND Extended Attribute. The second extended attribute displays correctly, but it is overriding the values in the first extended attribute. Any pointers you can give is much appreciated.

When I step thru the code the values in both “OutlineCodeDefinition” and “ExtendedAttributeDefinition” are correct. It seems like MS Project makes changes when “ExtendedAttributeDefinition” is added to Project.

Thank you much for your assistance.
Cole

Hi Cole,


We have investigated your code and observed no issue in the program logic. It seems to be issue while saving the project as MPP file using Aspose.Tasks. It is logged under Id: TASKS-34571 for further investigation by the product team. You will be automatically notified once any update is received in this regard.

Hi,

What’s the status on TASKS-34571? Will this be fixed in days/weeks/months? What’s the expected fixed release date?

Thanks.
Cole

Hi Cole,


The issue is currently under investigation by our Product team and we have requested them about the expected fixed release date. We’ll update you here once there is some information or a fix version available in this regard.

What’s the status on this Task? What’s the estimated fix date?

Thanks,
Cole

Hi,


The issue is still pending for resolution and there is no ETA available. We have requested about the ETA from our Product team and will update you here once there is some information available in this regard.

Hi,


We have prepared hotfix verison for TASKS-34571 that you can download from here. Please note that we have made some improvements for working with Extended Attributes for simplification purpose. Some examples for working with the simplified implementation are as follow:

Creating Custom Text Attribute and Adding to Task

var taskExtendedAttributeText9Definition = ExtendedAttributeDefinition.CreateTaskDefinition(CustomFieldType.Text, ExtendedAttributeTask.Text9, “Task City Name”);
proj.ExtendedAttributes.Add(taskExtendedAttributeText9Definition);
var task = proj.RootTask.Children.Add(“Task 1”);
var taskExtendedAttributeText9 = taskExtendedAttributeText9Definition.CreateExtendedAttribute();
taskExtendedAttributeText9.Value = “London”;
task.ExtendedAttributes.Add(taskExtendedAttributeText9);

Creating Custom Text Attribute with Lookup Table

var taskExtendedAttributeText9Definition = ExtendedAttributeDefinition.CreateLookupTaskDefinition(CustomFieldType.Text, ExtendedAttributeTask.Text9, “Task City Name”);
taskExtendedAttributeText9Definition.AddLookupValue(new Value { Id = 1, StringValue = “Value1”, Description = “This is Value1” });
taskExtendedAttributeText9Definition.AddLookupValue(new Value { Id = 2, StringValue = “Value2”, Description = “This is Value2” });
proj.ExtendedAttributes.Add(taskExtendedAttributeText9Definition);
var task = proj.RootTask.Children.Add(“Task 1”);
var taskExtendedAttributeText9 = taskExtendedAttributeText9Definition.CreateExtendedAttribute(taskExtendedAttributeText9Definition.ValueList[1]);
task.ExtendedAttributes.Add(taskExtendedAttributeText9);

Creating Custom Duration Attribute with Lookup Table

var taskExtendedAttributeDuration2Definition = ExtendedAttributeDefinition.CreateLookupTaskDefinition(CustomFieldType.Duration,
ExtendedAttributeTask.Duration2,
“Some duration”);
taskExtendedAttributeDuration2Definition.AddLookupValue(new Value { Id = 2, DurationValue = 4 * 60, Description = “4 hours” });
taskExtendedAttributeDuration2Definition.AddLookupValue(new Value { Id = 3, DurationValue = 8 * 60, Description = “1 day” });
taskExtendedAttributeDuration2Definition.AddLookupValue(new Value { Id = 4, DurationValue = 1 * 60, Description = “1 hour” });
taskExtendedAttributeDuration2Definition.AddLookupValue(new Value { Id = 7, DurationValue = 10 * 8 * 60, Description = “10 days” });
proj.ExtendedAttributes.Add(taskExtendedAttributeDuration2Definition);
var task = proj.RootTask.Children.Add(“Task 1”);
var taskExtendedAttributeDuration2 = taskExtendedAttributeDuration2Definition.CreateExtendedAttribute(taskExtendedAttributeDuration2Definition.ValueList[3]);
task.ExtendedAttributes.Add(taskExtendedAttributeDuration2);

Note: Currently (16.11.1 version) duration attributes can’t be saved to XML and read by MSP. There is a bug in MSP that causes this behavior.

Creating Custom DateTime Attribute with Lookup Table

var taskExtendedAttributeFinish2Definition = ExtendedAttributeDefinition.CreateLookupTaskDefinition(CustomFieldType.Finish,
ExtendedAttributeTask.Finish2,
“Some finish”);
taskExtendedAttributeFinish2Definition.AddLookupValue(new Value { Id = 2, DateTimeValue = new DateTime(1984, 01, 01, 00, 00, 01), Description = “This is Value2” });
taskExtendedAttributeFinish2Definition.AddLookupValue(new Value { Id = 3, DateTimeValue = new DateTime(1994, 01, 01, 00, 01, 01), Description = “This is Value3” });
taskExtendedAttributeFinish2Definition.AddLookupValue(new Value { Id = 4, DateTimeValue = new DateTime(2009, 12, 31, 00, 00, 00), Description = “This is Value4” });
taskExtendedAttributeFinish2Definition.AddLookupValue(new Value { Id = 7, DateTimeValue = DateTime.Now, Description = “This is Value6” });
proj.ExtendedAttributes.Add(taskExtendedAttributeFinish2Definition);
var task = proj.RootTask.Children.Add(“Task 1”);
var taskExtendedAttributeFinish2 = taskExtendedAttributeFinish2Definition.CreateExtendedAttribute(taskExtendedAttributeFinish2Definition.ValueList[3]);
task.ExtendedAttributes.Add(taskExtendedAttributeFinish2);