I have a project file (mpp) that I received from someone who got it from Microsoft Project Server. It has some "Enterprise" custom fields. When I open the project in MS Project I see the columns, I see the tasks, and I see each task's corresponding value in that column. But, I can't read them using MPXJ. What gives? I can find these fields via the "project.getCustomFields" method. What I can't seem to do is read the values from the individual tasks. For example:
ProjectReader project = reader.read(fileLocation);
List<task> myTasks = project.getTasks();
for (Task t : myTasks) {
Iterator<customfield> iterator = project.getCustomFields().iterator();
while (iterator.hasNext()) {
CustomField customField = iterator.next();
System.out.println(customField.getAlias() + " : " + t.getFieldByAlias(customField.getAlias()));
System.out.println("-----");
}
}</customfield></task>
Presumably would show me the different fields (and it does show me the 'interesting' fields, which are supposedly enterprise custom fields) and the value. But the value is always coming back as null.
Would you be able to provide a sample file?
I've provided the requested file, would you mind letting me know if you've looked at this or when you might look at it? Thanks, Jon.
I'm still attempting to get a scrubbed sample file. After some searching through the saved-as-XML file, I'm seeing:
<enterpriseextendedattribute>
<fieldidinhex>b408005</fieldidinhex>
<fieldid>188776453</fieldid>
<value>TEST</value>
<valueguid>TEST</valueguid>
</enterpriseextendedattribute>
I notice that https://sourceforge.net/p/mpxj/bugs/297/ addressed extended attributes, are these 'EnterpriseExtendedAttribute' properties being parsed at all?
Please find attached an example file with several instances of enterprise extended atributes. My understanding is that you will need Project Professional to open/view these fields as we are.
I am currently working on MPXJ changes relating to P6. Once I've completed that work I will look at this issue.
Quick update: I'm making progress, hopefully have some results tomorrow.
Last edit: Jon Iles 2020-10-19
I've merged changes which should allow you to read these fields. These changes will be part of the next MPXJ release.
One point to note if you haven't worked with enterprise custom fields before, the implementation hasn't had a lot of attention (it's not a frequently requested feature!) so for the moment there is no type conversion for these values, so there's an assumption that you know what types to expect - MPXJ i sjust going to giev you a byte array fo rthe value. In general I think you'll be dealing with strings so you should be able to do something like
new String(customFieldValue).