Create a UDF

Top  Previous  Next

Module:  Accounts Payable    

Applet: Vendors    

Toolbar: UDF Designer

 


Description: User-definable fields can be created for the following applets applets in InFocus:  Clients, Employees, Vendors, Projects, and Contacts.

 

Note: Whenever you are in one of these five setup screens, a "UDF Designer" button will appear on the tool bar, assuming you have proper permissions. You can also access any of the UDF designers from the UDF Designer applet located in the Administration module.

 

 

Step 1 -   If you are going to use a list, create the UDF list; otherwise, skip to Step 2. UDF lists provide drop-down lists for UDF fields. These non-restrictive lists allow a user to enter a value that is not contained in the list. Lists are maintained in the UDF Lists tab of the UDF Designer.

 

Add/Edit a UDF List

 

To add a list, enter a list name in the Lists box and click Add.

 

To rename or delete a list, right click on the list name and choose the appropriate action.

 

To add items to a list, first select the list from the list of lists. Next add an item in the List Item box and click Add.

 

To rename or delete a list, item right click on the list item and choose the appropriate action.

 

UDF_UDF_Lists

 

 

 

Step 2 - UDF fields can be added, modified, and changed from the UDF Fields tab in the UDF Designer. Fields can be added or modified in a grid format. To delete a UDF field, highlight the row and hit the Delete key.

 

 

Add a UDF Field

 

Fill out the following fields:

 

Label - This is the field label that will appear on the form next to the field.

 

Name -  This is the name of the field as it will appear in the associated UDF table in the database. Names cannot include punctuation marks (including spaces).

 

Data Type -  Type of data that is expected. Choices are character (text), integer, numeric, boolean (True/False), Date, and DateTime (includes both date and time).

 

Default - Default value for new records (optional)

 

Min - Minimum allowed value (optional)

 

Max - Maximum allowed value (optional)

 

List - UDF List to use for quick entry. This is the list that was created in step 1.

 

Validation Script - The purpose of this field is to validate the value entered into the UDF field via SQL script. The script can use two variables:

^udfvalue^ (the value being validated)

and

^keyid^ (the primary key of the record holding the udf)

The SQL script must return at least three values:

1) reterr (>=0 equals no error, <0 equals error)
2) retmsg (the error message if reterr <0)
3) retvalue (this can either be the same as the value passed in or it can be a new value. In either case, whatever is returned will be the value in the UDF field.

 

Click Save  when finished and the Vendor section will be rebuilt to contain the UDF Field.

 

UDF_UserFields