Jump 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.

[FMP-IF] statements not working...HELP!!!

Featured Replies

Hi,

Here we go again...just a little background first and then I'll get to the problem...

I am creating an online database so that students can register for placement exams. They must select a date and time from a list of radio buttons. If a date and time is full, I need to tell that student to select another date and time.

I orininally tried to run a script to give me this functionality, but since there is no way to catch any errors generated with it in CDML, I decided to try using the FMP-If statements. I have calculation fields within the database that keep track of how many are registered for a given date and time. My "new-reply.htm" format file contains the following FMP-if statement:

[FMP-IF: Field:Date1Total.gte.4]

<b>Sorry, the Exam Date and Time you selected is full. Click onto the back button to select a different date, and then re-submit your request.</b>

[FMP-ELSE]

<p>Your placement exam registration was successfully added. If you provided an email address,

you will receive an email confirmation shortly. Note: You will not receive an exam confirmation

via regular postal mail.</p>

[/FMP-IF]

BUT: Nothing displays when the page is brought up! Can someone please tell me what I am doing wrong?

Here are the links to the database if you need to see what I mean:

https://filemaker.ccsu.edu/data/TLC/default.htm

You will be prompted to enter a username and password; leave the username field blank and enter "ccsu" in the password field.

Click onto "New Record" to access the database.

Thanks for any help!

Cristy

Would a Calculated field, which counts the registrations, be of value. You could use this field to display if that course is full or not.

All the best.

Garry

Couple of things... is the Date1Total field a number field? It should be...

secondly, the CDML code should be:

[FMP-If: Date1Total.gte.4] ... your post had "Field:Date1Total", unless the name of the field is "Field:date1Total" of course.

You probably are better off using the fmp-if conditional. However you have written.

>I orininally tried to run a script to give me this functionality, but since there is no

>way to catch any errors generated with it in CDML ...

So you will perhaps develop a better understanding, there are ways to catch when ScriptMaker does not run a script and post the proper information to your client whose script did not run. It is largely a matter of design.

  • Author

Thanks for the tips.

Here is the problem though: The field is numeric, and within FM it is definitely keeping count of all of the registrations. I have testing it vigorously. However, when I use CDML, for example:

The current value of the counter is: [FMP: Field: Date1Counter]

Nothing appears after "is:" It is as if the CDML is not able to read the field value from the database. Also, within another test, when I do the conditionals, for example,

[FMP-If: Date1Counter.gte.4]

Show message

[FMP-Else]

Show another message

[/FMP-If]

Nothing happens. The other message associated with the else statement doesn't appear either.

If my field is numeric within the database, then why won't it show up on the web page using CDML?

hi there

why are you using:

The current value of the counter is:[FMP: Field: Date1Counter]

and not: [fmp-field:Date1Counter]

or: [FMP-IF: Field:Date1Total.gte.4]

and not: [fmp-if:Date1Total.gte.4]

i also would not use spaces in your [fmp]-tags

maybe this helps. let me know

best

mimmo

  • 2 weeks later...

I would also check the HTML source itself, some editors like to change the [ and ] brackets to their HTML counterparts.

"...some editors like to change the [ and ] brackets to their HTML counterparts."

The reason to write your own html/cdml from scratch.

Create an account or sign in to comment

Important Information

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

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.