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.

Limiting enrollment via the web.

Featured Replies

  • Newbies

Having a problem with a web-database that I'm hosting. Here's some general information.

maindb.fp5 (Parent Database)

course_id (Course ID)

desc (Course Description)

maximum_students (Maximum Students allowed Total)

maximum_sites (Maximum Sites allowed Total)

registration.fp5 (Child Database)

course_id (Related to course_id in maindb.fp5)

student_name

district_name

When you view the HTML/CDML file I have created for maindb.fp5 you see the course ID and description and then I have a portal that lists all the students who are "enrolled" for this particular course. When a student enrolls in a course via the web what should I be doing to get the registration.fp5 to check to see if the maximum_students or maximum_sites has been reached and if so, reject the entry? I've tried several methods and I'm not having much luck..

I had a calculations that was counting the number of students in the portal per class and giving me a total (worked fine when ran in FM) but the commands were not supported via the web. I was trying to get it to run this script upon submission &-script=total but still didn't work.

Any ideas would be greatly appreciated!!!

Any suggestions?

Hello Neo!

You should have taken the Blue Pil smile.gif

I think that you might not want to use scripts over the web(PERIOD).

it sounds like you need to use some condition such as IF statement:

---------------[theory]-------------------------

If field maximum_students is greater or equal than some value then dissallow addition of record

....else

allow addition of record

----------------------------------------------

code would be something like this:

---------------------|code:|-----------------------

[FMP-If: maximum_student .gte. 50]

sorry but we are at the Max capacity

[FMP-Else]

[FMP-InlineAction: -db=DBname.fp5,-lay=layoutName,DBfiled={formField},-New][FMP-InlineRequest]

--------------------------------------------------------

this will get you started, I am not really good at all this but I think this would work....if not maybe we can trigger more posts!

good luck

laugh.gif

  • Author
  • Newbies

I tried something like that.

[FMP-if: total_students .lt. maximum_students]

ENROLL NOW

[FMP-Else]

<b>Sorry, Enrollment is Closed.</b>

[/FMP-If]

And total_students is at 2 and maximum students is at 2 and it still displays the "ENROLL NOW" words.. Any ideas?

hm.....try testing it with "<=" less than or equals .lte

Hi, the syntax for an "FMP-If" expects literal text after the operator unless you tell it that it's a field, so

field:total students, less than or equal, field maximum_students should be:

[FMP-If:total_students.lte.field:maximum_students]

Not just the proper code, but the logic behind it.

Good show Jeff.Five Star answer.

"....if not maybe we can trigger more posts"

-see I told you! smile.gif

Create an account or sign in to comment

Important Information

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

Account

Navigation

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.