David Jondreau Posted January 5, 2009 Posted January 5, 2009 I can paste any length of text into that field. Maybe change the script step to: Set Field [ field; Left(field;10) and change the trigger to OnObjectModify?
JesseSFR Posted January 5, 2009 Posted January 5, 2009 Another way to approach this is to just disallow any key presses besides navigation keys after 10 characters have been entered. I love script triggers they are definitely going to provide many different, interesting approaches to a problem MaxLengthTest.zip
Raybaudi Posted January 5, 2009 Author Posted January 5, 2009 Hi JesseSFR your example suffers the same problem of mine: you can paste how many chars you want.
Steven H. Blackwell Posted January 5, 2009 Posted January 5, 2009 [color:red]Everyone please remember that the event triggers are not data validation tools. They work only on a specific instance of a field on a specific layout. If you need field validations, use the options in Manage Database.... Steven
Raybaudi Posted January 6, 2009 Author Posted January 6, 2009 Maybe change the script step to: Set Field [ field; Left(field;10) and change the trigger to OnObjectModify Yes, it seems a lot better... just I changed the script to: Set Field [ Left ( Get ( ActiveFieldContents ) ; 10 ) ] So it can be used on every field I wish.
Raybaudi Posted January 6, 2009 Author Posted January 6, 2009 [color:red]Everyone please remember that the event triggers are not data validation tools. Hi Steven that wasn't a validation use of triggers... It was only a way to stop the user entering data into a field.
Steven H. Blackwell Posted January 6, 2009 Posted January 6, 2009 that wasn't a validation use of triggers... It was only a way to stop the user entering data into a field. Same concept applies. If the field is elsewhere accessible, then the process does not work. Steven
Raybaudi Posted January 6, 2009 Author Posted January 6, 2009 Hmmm... If the field is elsewhere accessible, I'll attach it the same trigger.
David Jondreau Posted January 6, 2009 Posted January 6, 2009 And you can still attach validation to it to be sure. But the trigger is a nice interface option.
fabriceN Posted January 9, 2009 Posted January 9, 2009 ... and an auto enter to truncate the input. But Steven is absolutely right, the way triggers are implemented is ONLY about user interface, not about data integrity/security. There are many ways of working around a 'trigger protected field' (Set Field script step, new field object on layout, including adding it to a table view...)
Recommended Posts
This topic is 5795 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now