code: private void addUserDefinedField(FieldTypeClass fieldType, UserFieldDataType dataType, String name)
     {
        try
        {
           switch (fieldType)
           {
              case TASK:
                 TaskField taskField;
  
                 do
                 {
                    taskField = m_taskUdfCounters.nextField(TaskField.class, dataType);
                 }
                 while (m_taskFields.containsKey(taskField) || m_wbsFields.containsKey(taskField));
  
                 m_project.getCustomFields().getCustomField(taskField).setAlias(name);
  
                 break;
              case RESOURCE:
                 ResourceField resourceField;
  
                 do
                 {
                    resourceField = m_resourceUdfCounters.nextField(ResourceField.class, dataType);
                 }
                 while (m_resourceFields.containsKey(resourceField));
  
                 m_project.getCustomFields().getCustomField(resourceField).setAlias(name);
  
                 break;
              case ASSIGNMENT:
                 AssignmentField assignmentField;
  
                 do
                 {
                    assignmentField = m_assignmentUdfCounters.nextField(AssignmentField.class, dataType);
                 }
                 while (m_assignmentFields.containsKey(assignmentField));
  
                 m_project.getCustomFields().getCustomField(assignmentField).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.
           //
        }
     }
docs: Configure a new user defined field.
  
  @param fieldType field type
  @param dataType field data type
  @param name field name