Set Minimum and Maximum Character Length of Custom Zip Code Field Using Workflow

Setting a maximum character length on a Free-Form Text field can be configured under the Validation & Defaulting tab of the field setup, but setting a minimum character length is currently not an option. As a workaround, create a workflow that will return a user error if a field’s minimum character length is not met.

Solution
  1. Navigate to Customization > Workflow > Workflows > New
  2. Basic Information:
    • Name: Enter Set Character Length
    • Record Type: Select Customer
    • SubTypes: Select Customer/Lead/Prospect
    • Execute As Admin: Enter Checkmark
    • Release Status: Select Released
    • Initiation: Select Event Based
  3. Event Definition:
    • On Create: Enter Checkmark
    • On View or Update: Enter Checkmark
    • Trigger Type: Select -All-
  4. Click Save
  5. Click State 1
  6. Bottom right corner: Click New Action
  7. Click Return User Error
  8. Basic Information:
    • Trigger On: Select Before User Submit
  9. Condition:
    • Custom Formula: Enter a checkmark
    • Formula: Enter!isValEmpty(nlapiGetFieldValue(‘fieldID’).toUpperCase()) && nlapiGetFieldValue(‘fieldID’).length<parseInt(‘5’)
  10. Parameters:
    • Text: Enter Maximum Character Reached
  11. Click Save

Leave a comment

Your email address will not be published. Required fields are marked *