Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

This is a weird problem that I can't seem to get around. I don't what stage of the process is not doing it's job. Anyway -

I've got a date field that is set to validate as a four digit year date, and also strict validation. This works great as to be absolutely sure what century the date is refering to.

I set up a Show Custom Dialog script step, and the beforementioned date field is one of the input fields. It doesn't validate this field, so I could type in "Blah, Blah, Blah" in the input field, and it'll put that in the date field on the layout. If I click in and out of the field (on the layout) THEN the validation comes up. Is there something I'm missing, or is this a programming bug that FileMaker needs to take care of?

Either way, I still want to implement this Custom Dialog, so I'll have to "validate" the input myself. I suppose I could put in some IF conditions, but my mind comes up blank on how to see if the field is entered strictly as MM/DD/YYYY. Any ideas? confused.gif

Posted

That would be a great idea, but this solution is in FM6, not 7. I'm not aware of ay way to commit the record in 6. Plans to convert this to 7 are on the way, but that will be some time from now.

Actually, I made a mistake is my description. If I click in the field and click out, it doesn't perform the validation. It's only if I change the info (delete one of characters, for example) that it performs validation.

Posted

Ahh - I've never had a need to use that script step before. I tried as suggested (GOTO field, EXIT record), and it still didn't validate. Any other ideas?

Posted

How about Go to Field [field], Set Field [field, field], Exit Record/Request?

Posted

Sayyyy - that worked out pretty slick, Queue. It actually cleared the field if validation wasn't met. Well, to a point at least it'll work. If text or a mnumber was entered, it cleared. If I typed in the date as MM/DD/YY (instead of MM/DD/YYYY like I need it to), it'll format it to be in the 20th century, not the 21st as I "intended" it to be.

I suppose if the user didn't see that the field cleared instead of what they typed in, that's their problem. But, I know someone will complain sooner or later that "the dates aren't showing up!" or "I typed in 04 as the year, and it gave me 1904, not 2004!". To avoid that, I would still like to have some kind of message pop up if the date isn't formatted correctly.

Too bad there wasn't a "validate field" script step that would make this easier.

Posted

How about

If [Year(field) < 1990]

Set Field [field, Date( Month(Field), Day(field), Year(field) + 100 )

Else

Set field [field, field]

End If

Change 1990 to the lowest possible 20th century year you think you'll encounter.

This topic is 7403 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.