I have mpp file that have two custom date type fields defined. TaskDat1 does not uses custom lookup table, so the user can type anyting, but TaskDat2 uses lookup table, so user have to select a value from that table. When importing this file using below code, value for TaskDat1 one are coming over just file, but the value for TaskDat2 not the date type. Its int value. However, when same file is saved as xml and imported, its works file. I have attached both files for you to reproduce this issue.
foreach (ASP.ExtendedAttribute extendedAttribute in aspTask.ExtendedAttribute) { PROM.AttributeDefinition attDef = new PROM.AttributeDefinition(extendedAttribute.AttributeDefinition.Alias ?? extendedAttribute.AttributeDefinition.FieldName); _prom.AttributeDefinitions.Add(attDef);
if (extendedAttribute.AttributeDefinition.Alias != null) { promTask.AttributeValues.Add(_prom.AttributeDefinitions[extendedAttribute.AttributeDefinition.Alias ?? extendedAttribute.AttributeDefinition.FieldName], extendedAttribute.Value); } } foreach (ASP.ExtendedAttribute extendedAttribute in aspTask.ExtendedAttribute) { PROM.AttributeDefinition attDef = new PROM.AttributeDefinition(extendedAttribute.AttributeDefinition.Alias ?? extendedAttribute.AttributeDefinition.FieldName); _prom.AttributeDefinitions.Add(attDef);
I have analyzed the information provided by you and tried to reproduce it using the following code. In this code I displayed respective extended attributes along with the value and found that it was displaying TaskDat2 value as integer. Please verify if this is the issue which is indicated by you, otherwise please send us a console application which can be used to re-produce the issue. Once verified, we will log the issue in our issue tracking system.
//create a project reader instance
ProjectReader rdr = new ProjectReader();
//call read method of project reader object to get project object
Project prj = rdr.Read("EMAIL_428640\\Test Case 319.mpp");
//Declare ChildTasksCollector class object
ChildTasksCollector collector = new ChildTasksCollector();
//Use TaskUtils to get all children tasks in RootTask
TaskUtils.Apply(prj.RootTask, collector, 0);
//Parse all the recursive children
foreach (Task tsk in collector.Tasks)
{
Console.WriteLine("Task No. " + tsk.Uid);
ArrayList eas = tsk.ExtendedAttribute;
if (eas != null)
{
foreach (ExtendedAttribute extendedAttribute in eas)
{
if (extendedAttribute.AttributeDefinition.Alias == "TaskDat2" || extendedAttribute.AttributeDefinition.Alias == "TaskDat1")
I have forwarded these details, along with the sample MPP and XML files, to our development team for further investigation and will update you here once we have any information in this regard. The issue has been logged in our issue tracking system as: TASKS-33254.