Fidalguito Posted July 1, 2024 Posted July 1, 2024 Hello! I have a database in Filemaker Pro 19 that is used by over 3,500 people, each with a login (e.g., 071111). Due to the high number of users, I struggle to keep the scripts updated because they are manual. When there are registrations from multiple people, I have to go through each one manually to make the changes. I thought about creating automatic scripts where a user with account number 071111 logs in and wants to see which courses they are enrolled in. Is there a way to take the account number and automatically search to see which courses they are enrolled in, then direct them to a specific layout? This would greatly simplify my work. Thank you for your help.
comment Posted July 1, 2024 Posted July 1, 2024 (edited) What exactly is this "account number"? If it is the name of an account defined in your file, or an account authenticated via an external identity provider, then you can use the Get(AccountName) function to get it and use it in your search. You can even restrict their access to only their records, so that any find will automatically exclude all other records. If it's something else - IOW, if you are doing your own "login" procedure - then I would advise you to stop and reconsider. Edited July 1, 2024 by comment
Fidalguito Posted July 1, 2024 Author Posted July 1, 2024 The account number is a number that is defined in my file, it does not have any external authentication. The account number is also the same as the student number. And how would you implement this?
comment Posted July 1, 2024 Posted July 1, 2024 1 minute ago, Fidalguito said: And how would you implement this? Not sure what you mean by "this". And I don't think you have answered my question. To learn about the dangers in building your own login system, see for example: https://fmforums.com/blogs/entry/1411-some-vulnerabilities-associated-with-ersatz-log-on-systems/
Fidalguito Posted July 1, 2024 Author Posted July 1, 2024 The authentication is the filemaker's own and I thought that when he talked about external authentication he was referring to Google or Microsoft. Account A (071111) Layout Students - Subjects - enrolled in 3 and the subjects appear in a table Account B (908821) Layout Students - Subjects - not registered for any subject and so for the 3,500 people ideas to make this possible?
comment Posted July 2, 2024 Posted July 2, 2024 I am afraid this is not getting any clearer. As I said, if the "account number" 071111 is the user's account name, you can get it using the Get(AccountName) function. Otherwise you would need to store it in a global field or variable when the user enters it, and get it from there. Once you have it, it should be easy to use it to find the user's enrollments, assuming you have a field for this "account number" in the Enrollments table or in the Students table. 6 hours ago, Fidalguito said: Account A (071111) Layout Students - Subjects - enrolled in 3 and the subjects appear in a table Account B (908821) Layout Students - Subjects - not registered for any subject Sorry, I have no clue what any of this means. I believe you need to have a structure of: Students --< Enrollments >-- Subjects
Fidalguito Posted July 2, 2024 Author Posted July 2, 2024 Hello, Thank you for your patience in trying to resolve this problem. The account number is the same as the user number. I currently have this script that works. Do you have any idea to make this more "automatic" for 3,500 people? I am sending an image to help, sorry but I couldn't change the commands to English, they are in Portuguese.
comment Posted July 2, 2024 Posted July 2, 2024 (edited) 2 hours ago, Fidalguito said: Do you have any idea to make this more "automatic" for 3,500 people? Not really, because I don't understand why it cannot be the same for everyone. You are not showing us the stored find criteria. If you are searching for the account name, then I would expect to see something like: Enter Find Mode [] Set Field [ SomeTable::SomeField ; Get (AccountName) ] Perform Find [] or: Set Variable [ $accountName ; Get (AccountName) ] Perform Find [ Restore with the variable being used as the stored criteria. I also don't understand why you need different layouts for different users. Surely you don't intend to have 3,500 layouts?? If you have different categories of users that require different layouts, then store the user's category in a field of their record, then go to the appropriate layout after performing the find, based on that field. Or maybe the users belong to different privilege sets, in which case you could branch based on Get(AccountPrivilegeSetName). Edited July 2, 2024 by comment 1
Fidalguito Posted July 2, 2024 Author Posted July 2, 2024 At the time I wrote the scripts, I thought it was the best solution. I just had to add the accounts, and it worked. Account 071111, for example, would search in the enrollment table for the student number field, which is linked to the student table's student number field, and it would take me to the specific layout and display the records of the subjects the student was taking. It is only one layout, but when clicking the button, it performs the entire process automatically. What I would like is to find a way not to always have to write the script when I need to add new accounts. I don’t know the script commands very well, so I only know the basics. That's why I came here to ask for help, but the script is the same for all, meaning all accounts perform the above-mentioned process. Thank you for your patience.
comment Posted July 2, 2024 Posted July 2, 2024 28 minutes ago, Fidalguito said: What I would like is to find a way not to always have to write the script when I need to add new accounts. That is what I tried to provide in my last post.
Fidalguito Posted July 2, 2024 Author Posted July 2, 2024 It works, thank you very much! This is exactly what I needed. Would there be a possibility of not having to press "enter" to complete the search? But either way, thank you very much.
comment Posted July 2, 2024 Posted July 2, 2024 (edited) 1 hour ago, Fidalguito said: Would there be a possibility of not having to press "enter" to complete the search? Didn't you say you use a button to call the script? If so, there should be no need "to press "enter" to complete the search". Perhaps your script has: Enter Find Mode [ Pause ] instead of just: Enter Find Mode [] ? Edited July 2, 2024 by comment
Fidalguito Posted July 2, 2024 Author Posted July 2, 2024 Yes, I said it, but when I click the button, it enters search mode and only ends if I press 'enter,' whether the search mode is activated or deactivated in the script.
Recommended Posts
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