Newbies Tazz Posted August 31, 2002 Newbies Posted August 31, 2002 Hi filemaker pros i need some help here .... Im realy bad on calculations /scripting but i do the best i can to learn i have a customer system that is based on 6 different fm 5.0 dbs all databases get company info from a system database. Now i want to have a expire date thats checks if the date is expired. Ii have made a field in that system db called expiredate and i need to check if it is equal to today or less ? and take action to that ...depending of the result. one nice solution is if it is posible to switch the login user if the date is passed and then set that user to read only. or does i need to kick them out with some msg telling them to uppdate ? How can i make this ... is it posible ...
LiveOak Posted August 31, 2002 Posted August 31, 2002 Many options are possible. You need to decide how you want your solution to behave, then we can help you with how to implement this behavior. What exactly are you trying to expire? The whole solution? A single user's access? If this is a customer system, what is your business relationship that you need to expire its use? -bd
CobaltSky Posted September 1, 2002 Posted September 1, 2002 Checking whether the expiry date is past is as simple as including a script or calculation If statement which contains the test: If ["ExpireDate < Status(CurrentDate)"] In order to implement an expiry function, you'll need to think about when you want checking to occur. Most commonly this is done at system start. If using start, you will need to establish a way to ensure that the relevant script will always be run. One way to achieve this is to: 1. Set the script which checks the exiry date against the current date to run as a start-up script in your main solution file (the one that users will typically start off in, and 2. Make a script which calls the start-up script in your main file (as an external script) within each other file of your solution, and set it as the start-up script in each file. That way, no matter which file a user opens, you can be confident that the start-up script will still run. If you want to restrict access to read-only after the expiry date has been used, here are a couple of approaches you might consider: 1. Create a separate set of layouts which operate independently (ie copies of your 'normal' layouts) with the 'Allow entry into field' attribute turned off for all the fields (then set your start-up script and any other scripts which take users between layouts to always go to the read-only layouts if the expiry date has passed). 2. Set a calculation validation on all your fields with the formula not ExpireDate < Status(CurrentDate), along with a custom error message. Or if you simply want to deny access, you might use the seuqnce of steps in your start-up script: If ["ExpireDate < Status(CurrentDate)"] Show Message ["This solution has now expired. Contact xxx for an update."] Show Message ["The application will now terminate..."] Exit Application Be aware, however, that the approaches outlined above are not highly secure, and could be circumvented by determined/resourceful users. Various techniques such as encryption could be used to improve its security, but nothing is ever entirely 'safe'. You'll find some interesting threads elsewhere on this forum on related subjects.
Recommended Posts
This topic is 8117 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 accountSign in
Already have an account? Sign in here.
Sign In Now