Difference between revisions of "Custom Client Fields"

From WHMCS Documentation

(Add or Edit a Custom Field)
Line 8: Line 8:
  
 
# Locate the desired custom field to edit or create a new custom field under '''Add New Custom Field'''.
 
# Locate the desired custom field to edit or create a new custom field under '''Add New Custom Field'''.
# Enter a field name.
+
# Enter the requested field information and choose a field type.
# Enter a number that corresponds to the order in which you want the custom field to display.
+
# Check the appropriate checkboxes to show or hide the field or require a response.
# 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|Invoices]]''' tab at '''Configuration (<i class="fa fa-wrench" aria-hidden="true"></i>) > 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'''.
 
# Click '''Save Changes'''.
  
== Regular Expression Validation ==
+
For more information about custom field configuration, see [[Custom Fields]].
 
 
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.
 
 
 
<div class="docs-alert-warning">
 
You must properly escape any forward slashes in your regular expression using back slashes: \/
 
</div>
 

Revision as of 20:16, 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:

  1. Locate the desired custom field to edit or create a new custom field under Add New Custom Field.
  2. Enter the requested field information and choose a field type.
  3. Check the appropriate checkboxes to show or hide the field or require a response.
  4. Click Save Changes.

For more information about custom field configuration, see Custom Fields.