code: private FieldType addUserDefinedField(FieldTypeClass fieldType, UserFieldDataType dataType, String name)
     {
        FieldType field = null;
        
        try
        {
           switch (fieldType)
           {
              case TASK:
              {
                 do
                 {
                    field = m_taskUdfCounters.nextField(TaskField.class, dataType);
                 }
                 while (RESERVED_TASK_FIELDS.contains(field));
  
                 m_projectFile.getCustomFields().getCustomField(field).setAlias(name);
  
                 break;
              }
              
              case RESOURCE:
              {
                 field = m_resourceUdfCounters.nextField(ResourceField.class, dataType);
                 m_projectFile.getCustomFields().getCustomField(field).setAlias(name);
                 break;
              }
              
              case ASSIGNMENT:
              {
                 field = m_assignmentUdfCounters.nextField(AssignmentField.class, dataType);
                 m_projectFile.getCustomFields().getCustomField(field).setAlias(name);
                 break;
              }
              
              default:
              {
                 break;
              }
           }         
        }
  
        catch (Exception ex)
        {
           //
           // SF#227: If we get an exception thrown here... it's likely that
           // we've run out of user defined fields, for example
           // there are only 30 TEXT fields. We'll ignore this: the user
           // defined field won't be mapped to an alias, so we'll
           // ignore it when we read in the values.
           //
        }
        
        return field;
     }
docs: Map the Primavera UDF to a custom field.
  
  @param fieldType parent object type
  @param dataType UDF data type
  @param name UDF name
  @return FieldType instance