Hi,
I am having trouble configuring extended attributes. I am setting different look up sets for two extended attributes. When I step through my code and look at the Project.ExtendedAttributes parameters, Text1 and Text2 have different value lists. But when the file is saved as an mpp and viewed in Microsoft Project, they both have the same drop down lookup set.
Any thoughts?
Thanks,
Ian
void AddTeamExtendedAttributes()
{
_teamExAttr = ExtendedAttributeDefinition.CreateLookupTaskDefinition(CustomFieldType.Text, ExtendedAttributeTask.Text1, "Team");
//Add lookup values for the extended attribute definition
for (int i = 0; i < SelectedTeams.Count; i++)
{
_teamExAttr.AddLookupValue(new Value
{
Id = i,
StringValue = SelectedTeams[i].Name,
Description = SelectedTeams[i].Description
});
}
_project.ExtendedAttributes.Add(_teamExAttr);
}
void AddFunctionalLocationExtendedAttribute()
{
_functionalLocExAttr = ExtendedAttributeDefinition.CreateLookupTaskDefinition(CustomFieldType.Text, ExtendedAttributeTask.Text2, "Functional Location");
var locationsUsed = SelectedActivitySplit.Where(x => x.Location != null)
.GroupBy(y => y.Location.Id)
.Select(y => y.First()).ToList();
//Add lookup values for the extended attribute definition
for (int i = 0; i < locationsUsed.Count; i++)
{
var location = SelectedLocations.First(x => x.Id == locationsUsed[i].Location.Id);
_functionalLocExAttr.AddLookupValue(new Value
{
Id = i,
StringValue = location.Code,
Description = location.Description
});
}
//Add it to the project's Extended Attributes collection
_project.ExtendedAttributes.Add(_functionalLocExAttr);
}