I'm trying to implement a character limit that will not let the user conintue typing once the limit is reached. What I have so far is the following but it's not working the way I'd like. First off I'm unsure how to count spaces as well. Second, I can hit the limit, the rror message pops up, the limit is in theory correct (minus the lack of space count) but if you continue typing it removes the last character typed and replces it with the latest one you've typed instead of completely ignoring the last thing typed.
Set Variable [$Count; Value: Length ( Purchases::Comments )]
If [$CCount 320]
Show Custom Dialog [custome dialog here]
Set Variable [$CommentFilter; Value:Left ( Purchases::Comments; 319)]
Set Field [Purchases::Comments; $CommentFilter]