Layer Properties - Display - Display Expression & Hyperlinks Default Fields

Idea created by 1_BCP_GIS on Oct 26, 2011
    Problem: The default value for the layer's Display Expression is often NULL

    At present, it appears that the default field that is used for the "Display Expression" is selected with this logic:
    "The display expression defaults to the first field of string type that contains the text name (case insensitive) in the field name. If no name field exists, the display field defaults to the first field of string type, then the first field of integer type, then the first field of any type. You can change the field used in the display expression on the Display tab of the Layer Properties or Table Properties dialog box." (Desktop Help 10.0 - Understanding the display expression for a field)
    Can I see a show of hands for all the folks out there that actually have the field NAME assigned to every data layer?! And then the backup of defaulting to the next string field doesn't take into consideration that there may be NULL values for some records. NULL values for the Display causes many glitches (i.e. If the Identify tool is used for an entity that has a NULL value in the Display Field, you cannot drill down to the related tables). Maybe it wouldn't be so awful if you could actually reorder the fields (at the database level, but that's another topic altogether).

    Solution: Get rid of that logic, it doesn't work. Allow the user to assign the default display field at the Feature Class level, not the layer. Or check for a field that doesn't allow null values, or just default to the ObjectId, one that will always be populated. By trying to add something smart to the program, it's just made it worse; keep it simple.

    Also, if you can set the default for the Display field to be NAME, then shouldn't the default hyperlink field look for a field called "hyperlink" first? Rather than "the first field of string type"?!