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

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

Recommended Posts

  • Newbies
Posted

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?

Posted

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

  • Newbies
Posted

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?

Posted

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]

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