midnite11
midnite11

Reputation: 91

MPXJ - how to get MSP Field List

We are using MPXJ v10.5. We are implementing with mpxj-for-csharp.dll.

We want to provide our users with a pick list of all of the default MSP Task Fields and also any user Custom Fields added. The the Field Name is all we need.

We believe we have something working for the customfields (below - we could probably work with this) but cannot find anything equivalent for the MSP "Out of the Box" Task Fields.

foreach(net.sf.mpxj.CustomField cf in file.CustomFields.ToIEnumerable())
{
     TextBox.AppendText("Alias: " + cf.Alias + " || " + cf.ToString());
}

Can anybody provide any suggestions for the Task fields?

Thank you.

Upvotes: 0

Views: 120

Answers (1)

Jon Iles
Jon Iles

Reputation: 2579

MPXJ defines an enumeration for the fields provided by the main entities it works with: ProjectField, TaskField, ResourceField, AssignmentField. You can iterate through these enumerations using the values method, for example:

foreach (TaskField field in TaskField.values())
{
    Console.WriteLine(field.ToString());
}

Upvotes: 0

Related Questions