Hi,
I am curious about behavior of Default property on ExtendedAttributeDefinition.
My code is below.
My expectation was that once I set the Default, this value would appear in the cells of the “customized column” in the Microsoft Project Task Usage worksheet without the user having to select.
Is there something I am missing to get this desired behavior.
Thanks,
Doug
ExtendedAttributeDefinition ead = new ExtendedAttributeDefinition();
ead.FieldName = m.MicrosoftProjectColumnName; // “Text1”
ead.Alias = m.ListTypeName; // “MyColumnName”
ead.FieldId = Convert.ToInt32(m.MicrosoftProjectFieldId).ToString(); // m.Field = ExtendedAttributeTask.Text1
ead.CfType = CustomFieldType.Text;
ead.LookupUid = Guid.NewGuid().ToString();
ead.AppendNewValues = false;
ead.RestrictValues = true;
ead.ValueList = new List();
foreach (Item i in m.ListItems)
{
string name = i.Name.Replace(",", “|”).Replace(" ", " "); //clean-up name; just a string
Value v = new Value();
v.Val = name;
if (!m.HideDescription)
{
v.Description = i.Description;
}
v.Id = _ListItemID;
i.MicrosoftProjectId = _ListItemID; // save this so as to correlate value selection with ListItem Guid later
ead.ValueList.Add(v);
_ListItemID += 1;
}
ead.Default = m.DefaultValue;
prj.ExtendedAttributes.Add(ead);