Set maximum length for a custom field of type text area or rich text area.
Internal ID = custbody_max_length
- Navigate to Customization > Workflows > Workflow > New
- Enter a Name for your workflow. (Ex. Maximum Length)
- Select the Record Type. (If your field is a transaction body field, you should select Transaction)
- Select the Sub Types
- Set the Release Status to Released
- In the Initiation box, check the On Create & On Update checkboxes
- Click the New State button on the left hand side of the workflow window
- Enter the a name for the state and Save
- Click New Action button on the Actions tab and select Return User Error with:
- Trigger on Before User Submit
- Custom Formula radio button in the Condition section Checked
- The formula below:
!isValEmpty(nlapiGetFieldValue('custbody_max_length').toUpperCase()) && nlapiGetFieldValue('custbody_max_length').length>parseInt('5')
- The error message you would like to show on the Text field of the Parameters section.
(Ex. The maximum characters allowed on this field is only 5.)
Note: This can be a workaround for Issue 66573.