UDF's - Validating Letters to Words

If I want to add a UDF similar to the Product Type, how can I have a list of descriptive options in the field drop down but only store one character in the database?

As an example, Product Type has 4 options - Finished, Raw Material, Kit, and Discontinued, but the CI_Item data table only stores 1 character - F,R,K, and D.  The notes in the file layout show:

Notes: F=Finished Good, R=Raw Material, D=Discontinued, K=Kit, Space=Blank

Can UDFs store in the same manner?
  • 0

    That can probably be done with a script and another UDF to store the single character.

  • 0

    Use a User Defined Table instead of the UDF's list type.  Create a UDT with 2 fields: Code and Description.  Create the UDF with the same data type and size as the Code in the new table, then link the table to it on the Validation tab.  The field will not be a drop-down list, it will be a lookup field with a magnifying glass lookup.  (You can also add the Description field from the UDT to the field using Customizer, so when the code is selected, the user can see the Description too.)