Jump to content

Limiting the number of records that can be created


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

Recommended Posts

Hello everyone. I am brand new to this forum, and obviously a newbie to filemaker. I have a database and I want to limit the user to being only able to create a certain number of records. For example, one module is CD's. I want to limit the user from only being able to add 5 records. or 3. or however many. How can I do this? This question may seem simple to many of you, but for a 58 yr old looking to get into filemaker creation as a hobby, not so simple. Thank you for your help.

Link to comment
Share on other sites

Welcome to FM Forums, Zcast.

Limiting the number of records a user can create isn't a typical request, and I'm curious as to why this is a requirement.

However, you could have your New Record script count the number of existing records and if it's at your maximum allowed, then show a dialog to the user "Max Reached".

Or, you could set a RLA (Record Level Access) calc to only allow creation of records in a table based on total record count being less than the maximum.

Link to comment
Share on other sites

Thank you for your help bcooney. I wnt to limit the amount of records to make a "demo" or "trial" version of a file for music cataloggers. Can you give me a hint as to what that new record script would look like for a table named "cd"? Thank you again for your help.

Link to comment
Share on other sites

Well, a simple script would be:


If [Get ( TotalRecordCount ) < 6]

New Record/Request

Else

 Show Custom Dialog [ "Maximum Reached"]

End If

However, what happens then? Are you offering a way to unlock the system? Would a user have to rekey all their data in a new "unlocked" version?

Link to comment
Share on other sites

It would definitely be easier and more professional to be able to simply "unlock" the system with say a "serial number", but that is WAY beyond my abilities at this time (hence the question regarding records), but I was simply going to limit them to creating three records then if they wanted to purchase the file, I would send them a full version. Is there an "easy" way to unlock the system?

PS...thanks for ALL your help!

Zcast

Link to comment
Share on other sites

imho, it's not easy to unlock the system without giving all his friends the ability to also unlock the system. Creating a code unique to the user typically involves his sending a key that is generated from his system, and you returning the unlock key.

3 recs isn't a big deal to force re-keying. Be aware that if you give them the ability to delete records, then they can live under the 3 record limit. That might matter in your case.

Link to comment
Share on other sites

Yes, I was looking at "Easy Encryption" to help with that. Otherwise, not much I can do to stop him from sharing with all his friends. Where would I run that simple script that you showed me above? I went into "manage scripts". clicked on "perform script", brought that over, then chose my "cd" table in the drop down, pasted in the script, but when I click ok, it says

"specified table cannot be found". Like I said, I'm VERY new to this whole thing, I get the design portion much more than the scripting portion. I truly do appreciate your help, as I know you usually get paid for this advice.

Thanks,

Zcast

Link to comment
Share on other sites

Ok, I went into A and P, went to setup new privilege set, got to the area where you choose which table, but under create, it doesn't give me the "limited" choice, as to where I can put the script to run. Apparently, I'm too old to get into learning something new..ha.ha..HELP!

Link to comment
Share on other sites

As you'll see using FM, there's often more than one approach. Validation is very secure, but doesn't offer imho a nice dialog to the user when the validation fails. I've never understood the choices!

Link to comment
Share on other sites

Thanks for agreeing, LaRetta.

So, Zcast, you can do both! A script and the validation.

BTW, I have used Dunning's Easy Encrypt on a commercial runtime. It's fine, but automating an unlock routine is much better. Haven't figured that out yet.

Link to comment
Share on other sites

Wow, you two are great. I still havent figure out the script part, at the "If" statement, it keeps saying that the "table cannot be found", I'm sure it's something very easy that I'm just not getting. When I paste the entire script you gave me bcooney, it highlights the "if" statement, and says "table cannot be found". I would realy like to earn both ways, and thanks for being patient with the old newbie!

Link to comment
Share on other sites

About the only reliable way to limit record creation is to block creation in the Record Level Access Privilege setup. Then run a script with full access privileges that checks record count (not found count) and then creates a record if the total record count is below your threshold.

HTH

Steven

Link to comment
Share on other sites

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