I'm working on a lightning component which stores it's data to a Salesforce Long Text Area custom field of size 600 on the Account object. In the component, we have an html text area, upon each keyup, we udate the character count. So we display the amount of characters left out of 600. We use the standard length method of javascript. The count goes from 600 down to 0 as expected. Once it's saved to the custom field, if I edit that field in account layout directly and save it without changing anything, it says that I'm 5 characters above the limit. We don't add anything to the string or convert anything when we save it. Is this a known issue? Are there any ways to fix this? I tried pretty much everything I could find on getting an accurate character count, nothing worked. I don't know where the 5 extra characters come from in SF.

  • Does the text you're working with include any non-Roman or accented characters? – David Reed Oct 2 '18 at 16:29
  • @DavidReed No, it's all standard characters. And will only be standard characters. – Daniel Cedilotte Oct 2 '18 at 17:20
  • 3
    Can you include some relevant code we can use to recreate the issue in a developer org? – David Reed Oct 2 '18 at 17:22
  • @DavidReed Sorry it took me a while to answer. We decided to put this issue on the back burner for now and go forward with the solution as is. I'll try to post the code over the weekend. – Daniel Cedilotte Nov 20 '18 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.