January 10, 201015 yr I'm aware that you can set a character size within Filemaker, however on the layout there is no way that i am aware of to lock the size of the field, so that a user does not continue to type past the field limit size only to be later notified that they have exceeded the limit of the field characters. In the case of a solution that we use we have a narrative field. Often new users are unaware that they must stay within the size of the field on the layout and type past the limit because there is no way until they commit the record to advise them that they have reached the limit. The same would then apply for the script trigger which will not trigger until the field is committed. By allowing a lock of the size of the field on the layout users would not continue typing over the limit of the field on the layout.... Unless I am missing an existing feature (please tell me if I am) I think that this would be a welcomed modification. Thanks, Ron
January 10, 201015 yr I think the current OnObjectKeystroke trigger allow you to program a maximum number of typed characters. Use this in addition to the OnObjectModify trigger to handle text pasted into the field. Edited January 10, 201015 yr by Guest
January 10, 201015 yr Author You're correct in this, however the issue that I have encountered is that when the users hit the carrige return (or the enter Key) to start a new paragraph, it will not count as characters entered from that point to the point of the cursor on the new line, thus pushing the txt farther along in the text field and defeating the purpose... Again, If you can suggest an alternative I would be very appreciative.
January 10, 201015 yr when the users hit the carrige return (or the enter Key) to start a new paragraph, it will not count as characters entered from that point to the point of the cursor on the new line, If I understand you correctly, you want don't want to limit the number of characters in the field as much as limit the number of characters for each line in the field like a manual typewriter. A script like this triggered by OnObjectKeystroke works mostly like a typewriter limiting typing on each line to 70 chars. The script consists of only one line with a calculation in the Exit Script step. This only limits the last line being typed. If the user goes back and adds text to previous lines, it is not inhibited by this script. ExitScript[ Case( Code(Get ( TriggerKeystroke ) ) < 32 ; 1; /* Special codes are always permitted */ (PatternCount(MyTable::Description; "¶") > 0) and (Length(MyTable::Description) - Position ( MyTable::Description ; "¶" ; 1 ; PatternCount(MyTable::Description; "¶") ) ≥ 70); 0; (PatternCount(MyTable::Description; "¶") = 0) and (Length(MyTable::Description) ≥ 70); 0; 1 ) ]
January 14, 201015 yr Author I'll tinker with this... It looks like a nice script that may work for me and I thank you for the suggestion!
Create an account or sign in to comment