Character limit for richtext

Can we set character limit for rich text field

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer

    Since there is no parameter to achieve this, we need to add this as a validation, explore on the options to remove the HTML tags either by using striphtml() or substitute() functions. Problem with using striphtml() is that it converts all tags to newline characters which will add extra characters to our resultset, take this into consideration as we cannot simply wrap substitute() on top to get rid of char(10)s as the actual text may contain them which we are not supposed to exclude.

    validations: if(
            len(striphtml(local!data)) > 100,
            "Please enter less than 100 characters",
            ""
          )

Reply
  • +1
    Certified Senior Developer

    Since there is no parameter to achieve this, we need to add this as a validation, explore on the options to remove the HTML tags either by using striphtml() or substitute() functions. Problem with using striphtml() is that it converts all tags to newline characters which will add extra characters to our resultset, take this into consideration as we cannot simply wrap substitute() on top to get rid of char(10)s as the actual text may contain them which we are not supposed to exclude.

    validations: if(
            len(striphtml(local!data)) > 100,
            "Please enter less than 100 characters",
            ""
          )

Children
No Data