Sunday, October 14, 2018

Set Maximum Length for Custom Fields of Type Rich Text or Text Area

Set maximum length for a custom field of type text area or rich text area.
Internal ID = custbody_max_length

Solution:

  1. Navigate to CustomizationWorkflows > Workflow > New
  2. Enter a Name for your workflow. (Ex. Maximum Length)
  3. Select the Record Type. (If your field is a transaction body field, you should select Transaction)
  4. Select the Sub Types
  5. Set the Release Status to Released
  6. In the Initiation box, check the On Create & On Update checkboxes
  7. Save
  8. Click the New State button on the left hand side of the workflow window
  9. Enter the a name for the state and Save
  10. 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.)
  11. Save

Note: This can be a workaround for Issue 66573.

No comments:

Post a Comment