Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Error Capture?

Featured Replies

Ok, if I do this calc in a calc field and result text:

Date("NonDateText")

I get a result of "?"

so, is there a way to capture this error and with a case statement offer an alternative answer?

FileMaker will only accept Dates in Date Fields, and if you want to convert text to a date, then you will need to use one of the Date Functions depending on how the text is.

What does the text look like?

Lee

  • Author

I understand it will fail. That is my point. Can I catch the error w/ something?

Can you explain where you will be using this, and what for? Without it, the question is too wide (i.e. too many possible answers).

BTW, Date ("string") will always return an error, no matter what the string is.

Edited by Guest

Possibly an IsValid ( ) ? It would return 1 (boolean true) if it was a date field but the date was not recognizable by FM, ie, IsValid(textDate)

Yes. We can't know without more information but I got the better of myself ... :

Edited by Guest

  • Author

Can you explain where you will be using this, and what for? Without it, the question is too wide (i.e. too many possible answers).

BTW, Date ("string") will always return an error, no matter what the string is.

I know that Date ("string") will always return an error... let's pretend that a user entered "Last Monday" instead of 1/2/2000.... is there and error capture where i can allow errors to result as the text they were entered as?

Last Monday can't be entered into a date field. It would help to provide specific, real examples.

Edited by Guest

A user entered "Last Monday" instead of 1/2/2000 where? Let's NOT pretend, and have a clear picture of the situation instead.

Date ("1/2/2000") will also return an error, so I don't see how that's relevant.

Calculations don't return error codes, so you're on the wrong path right from the outset. Only script steps return error codes. The "?" is the closest thing you'll get to a calculation returning an error. (In fact that what it's returned for.)

LaRetta's suggestion of using IsValid() is a good one. That's exactly what the function has been created for.

You might have some luck with GetAsDate( Text ) but the success will depend on the OS date format (dd/mm/yyyy or mm/dd/yyyy) and the consistency of the data entry.

Otherwise you're going to have to parse the entered text, try to guess it's meaning and process it accordingly. It's not a trivial job.

Much frustration is caused by original posters trying to "generalise" their questions: subsequent posters spend time and effort answering the question posted only to be told "that's not really the case..."

Calculations don't return error codes

They can, if you want. For example,

EvaluationError ( Evaluate ( "Date ("1/2/2000")" ) )

will return 1201 ('Too few parameters in the function'). But it requires repeating the entire formula as text, which may not be convenient in most circumstances.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.