Error importing User Defined Fields in P6(MSPDI)
Closed this issue · 4 comments
When I try to import a project with udf, I get the error
UserDefinedField: Key: 188743945 has validation errors. Rejecting
UserDefinedField 'UserDefinedField: Key: 188743945' not imported
After a bit of research I noticed that if I replace the tag:
<ExtendedAttribute>
<FieldID>188743945</FieldID>
<FieldName>Text1</FieldName>
</ExtendedAttribute>
with
<ExtendedAttribute>
<FieldID>188743945</FieldID>
<Alias>Text1</Alias>
</ExtendedAttribute>
Everything works, can you please fix this (it would be nice if there was also an option to get the name of the original field from such a file when importing it into MPXJ)
This looks like the MSPDI file format, is that correct? Are you importing this into P6?
Yes, this is mspdi format, imported into P6(microsoft project xml)
There are a couple of things to consider. The first thing is that you really should be generating a PMXML file if you are intending your schedule to be imported into P6.
The second thing is that I believe the MSPDI import as implemented by P6 has some bugs. I've set up an example MPP file to illustrate what I mean. I created a test MPP file with Text1 and Text2 used to store values. Text1 has an alias defined, Text2 does not. Here is what MS Project writes when you save this project as an MSPDI file:
<ExtendedAttributes>
<ExtendedAttribute>
<FieldID>188743731</FieldID>
<FieldName>Text1</FieldName>
<Alias>Text1Alias</Alias>
<Guid>000039B7-8BBE-4CEB-82C4-FA8C0B400033</Guid>
<SecondaryPID>255869028</SecondaryPID>
<SecondaryGuid>000039B7-8BBE-4CEB-82C4-FA8C0F404064</SecondaryGuid>
</ExtendedAttribute>
<ExtendedAttribute>
<FieldID>188743734</FieldID>
<FieldName>Text2</FieldName>
<Guid>000039B7-8BBE-4CEB-82C4-FA8C0B400036</Guid>
<SecondaryPID>255869029</SecondaryPID>
<SecondaryGuid>000039B7-8BBE-4CEB-82C4-FA8C0F404065</SecondaryGuid>
</ExtendedAttribute>
</ExtendedAttributes>
You can see that Text1 has an Alias
tag (as it has an alias) and Text2 does not. This is XML generated by Microsoft Project - MPXJ aims to follow this as closely as possible, hence when a field does not have an alias, we don't write an Alias
tag. (I have attached the XML file for you to try).
When you import this file into P6 you see the same error as you reported when you open this issue. Ideally Oracle need to fix the issue with their MSPDI importer and correctly handle custom fields without an alias.
As I think the issue is with P6, I'm not planning to modify MPXJ, but there are two things you can do.
- Write your schedule as a PMXML file - it will work much better with P6
- If you really have to use MSPDI, you will have to ensure that you always add an alias for any custom fields you use when you create your schedule, even if that alias just matches the field name. That should ensure that P6 finds the file acceptable.
Hope that helps!
Thank you very much for your time, you were absolutely right, the error is on the P6 side, when importing into Microsoft Project (app), everything works fine