Displaying UDFs on Names Screen Coding Options
The following are Coding items that can be used in Names UDF Display.
Note: date, numeric, and logical fields must turned into character values to be included in the display. You must use the appropriate formatting functions to do this. See the Formatting Functions section of this topic for more information.
Coding Items
- UDF Label Fields - you can use the label of the UDF field you want to display, as set on Name UDFs. The name of the label must be prefaces by the Labels table name.
Example: labels.udfc1
- Text Strings - use text strings as labels and identifiers between fields. Text strings MUST be enclosed in quotation marks "".
Examples: "Spouse: ", ": ","="
- Fields – the name of the field you want to display prefaced by the table name. You can use fields from Names and NameUDFs.
Example: names,nmdisable, nameudfs.nudfc1
- + (plus sign) Concatenation Marks - Concatenation mark are used to join the pieces of your Names UDF display together.
Example: labels.udfc1+"="+nameudfs.nudfc1, "Spouse: "+nameudfs.nudfc1
- Formatting Functions - use these functions to format your labels and fields.
TRIM - trims off any spaces at the end of a label or field.
DTOC or TRIMDATE - turns date fields into character values. TRIMDATE allows you to specify the date format (e.g. return 2 digit year, mm/dd/yy).
STR - turns numeric fields into character values.
SHOWTF - turns logical fields into character values with the ability to return Yes/No or True/False.
ADDNMUNL - returns the specified Unlimited Name UDF. Note: Unlimited UDFs do not have labels so you will need to use a text string label.
Example Display Strings
These are some sample strings using the above items:
- Character UDF: trim(labels.udfc1)+"="+trim(nameudfs.nudfc1)
- Date UDF: trim(labels.udfd1)+"="+trimdate(nameudfs.nudfd1,7)
- Logical UDF: trim(labels.udfn1)+"="+showtf(nameudfs.nudfl1)
- Numeric UDF: trim(labels.udfn1)+"="+str(nameudfs.nudfn1,8,2)
- Unlimited UDF: "Spouse: ""+trim(addnmunl(names.nmid,”spouse_name”)
- Two fields on 1 line separated by /: trim(labels.udfc1)+"="+trim(nameudfs.nudfc1)+"/"+trim(labels.udfl1)+"="+showtf(nameudfs.nudfl1)
- Using the IIF and EMPTY functions to return 'No Data' if a field has no value: trim(labels.udfc1)+"="+iif(empty(nameudfs.nudfc1),"No Data",nameudfs.nudfc1)