Difference between revisions of "Custom Client Fields"
(Created page with "Custom fields allow you to collect additional information from your clients. WHMCS allows you to set up an unlimited number of customer fields that apply to clients, individua...") |
(→Add or Edit a Custom Field) |
||
Line 11: | Line 11: | ||
# Enter a number that corresponds to the order in which you want the custom field to display. | # Enter a number that corresponds to the order in which you want the custom field to display. | ||
# Choose a field type: | # Choose a field type: | ||
− | #* Text Box — For a text entry. | + | #* '''Text Box''' — For a text entry. |
− | #* Link/URL — A URL. The prefix http:// will automatically be prefixed to any value entered. | + | #* '''Link/URL''' — A URL. The prefix http:// will automatically be prefixed to any value entered. |
− | #* Password — A value to be encrypted, will appear as a password field type in the client area. | + | #* '''Password''' — A value to be encrypted, will appear as a password field type in the client area. |
− | #* Drop Down — A drop-down combo box for a selection of preset options. | + | #* '''Drop Down''' — A drop-down combo box for a selection of preset options. |
− | #* Checkbox — For a yes-or-no answer. | + | #* '''Checkbox''' — For a yes-or-no answer. |
− | #* Text Area — For a long text entry of multiple lines. | + | #* '''Text Area''' — For a long text entry of multiple lines. |
# Enter a description. | # Enter a description. | ||
# Enter a regular expression to use to validate the field's contents (see below). | # Enter a regular expression to use to validate the field's contents (see below). |
Revision as of 20:08, 3 February 2022
Custom fields allow you to collect additional information from your clients. WHMCS allows you to set up an unlimited number of customer fields that apply to clients, individual products and services, and support departments. You can set them as either admin-only for private use or public.
You can configure custom client fields at Configuration () > System Settings > Custom Client Fields.
Add or Edit a Custom Field
To add a custom field to your clients' profiles:
- Locate the desired custom field to edit or create a new custom field under Add New Custom Field.
- Enter a field name.
- Enter a number that corresponds to the order in which you want the custom field to display.
- Choose a field type:
- Text Box — For a text entry.
- Link/URL — A URL. The prefix http:// will automatically be prefixed to any value entered.
- Password — A value to be encrypted, will appear as a password field type in the client area.
- Drop Down — A drop-down combo box for a selection of preset options.
- Checkbox — For a yes-or-no answer.
- Text Area — For a long text entry of multiple lines.
- Enter a description.
- Enter a regular expression to use to validate the field's contents (see below).
- For Drop Down fields, enter a comma-separated list of options.
- Check Admin Only if you want to hide this in the Client Area.
- Check Required Field if you want to require a response.
- Check Show on Order Form if you want to display this field on the order form in the Client Area.
- Check Show on Invoice if you want this field to display on the client's invoices.
- You might want to display custom fields on invoices if, for example, you have a client custom field for a Tax ID or VAT Number.
- Client custom fields will display under the name and address information on the invoice. Product custom fields display as part of the line item descriptions for those products.
- If you enable Store Client Data Snapshot in the Invoices tab at Configuration () > System Settings > General Settings and then create or edit a custom field after invoice creation, the invoice won't reflect those changed values and new fields. However, future invoices will show them.
- Click Save Changes.
Regular Expression Validation
The regular expression validation rules allow you to define what value the field can accept. The system won't allow the user to proceed until it passes the validation rule. For example:
A domain name in the format "google.com":
/^([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)*\.([a-zA-Z]{2,6})$/
A username between 4 and 28 characters in length, allowing only alphanumeric characters and underscores:
/^[a-z\d_]{4,28}$/i
A telephone number in the following format: (###) ###-####
/^(\(?[0-9]{3,3}\)?|[0-9]{3,3}[-. ]?)[ ][0-9]{3,3}[-. ]?[0-9]{4,4}$/
A date in the format DD/MM/YYYY:
/^\d{1,2}\/\d{1,2}\/\d{4}$/
Numbers only (0-9, any length):
/^[0-9]+$/
See http://www.rexegg.com/regex-quickstart.html for a detailed guide.
You must properly escape any forward slashes in your regular expression using back slashes: \/