Jump to content

This topic is 8016 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi Paolo smile.gif

Oh indeed there is! I fought the same problem. You can use validation by calculation in field definition like this:

not PatternCount(yourtextfield, "

Posted

First, thank you.

This solves my problem only in part, since I'm trying to avoid CR at the time the user presses the key.

What I have is a "login" layout where the user types username and password (into two global fields) and then presses the "Ok" button that performs the validation check script.

User are used to press CR after they type the password instead of pressing "Ok". However this doesn't run the script, it only add a line in the password field.

Posted

Hi Paolo,

I'm trying to avoid CR at the time the user presses the key.

What I described would be in your "Field Definitions" using Validation by Calculation and would certainly stop a User from hitting return immediately when they did it. They they'd hit the OK button to run your script.

What version of FM are you using? Depending upon your version, you probably can validate a global field. To accomplish this, change your global text field to a regular text field in Field Definitions, apply the validation by calculation using the formula I provided then go back and change the field back to a global text field again. Users will be stopped COLD!! I promise. Regardless of whether you stop the User as soon as they hit enter, or whether you remove the carriage returns when the script runs, the Users will still have to hit the OK button to run the script. If you want the script to run upon field exit, you should use a plug-in.

LaRetta

Posted

Are you using a Set Field script step in moving the global to the permanent field?

If so, you could add the Substitute in your set field step. i.e.

Set Field [ [ YourRealField, Substitute(g_YourGlobalField, "

Posted

What I described would be in your "Field Definitions" using Validation by Calculation and would certainly stop a User from hitting return immediately when they did it. They they'd hit the OK button to run your script.

I was able to validate the global field but the user is not stopped until she exits the field (with tab or a mouse click somewhere)

Posted

Hi Paolo!

Yes, then you have it right!

You asked for a method to stop the insertion of carriage returns into the field. Immediate means during data-entry, as compared to having to run a script through your data later to clean it up. Your Users can't go to the next field until it's corrected! It will eliminate the need to run stripping scripts through your data and, if you search this Forum, the problems with carriage returns is major pain!

If what you want is to have your script run when the User hits enter, you'll probably need a plug-in frown.gif

LaRetta

Posted

Use a numeric field (eventually a global number field) for the data entry ... cannot be used in all circumstances but doesn't allow any carriage return

This topic is 8016 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.