March 12, 201015 yr I have a login script setup that searhes for the logged in user's record in the database. My script is setup as follows: Enter Find Mode [] Set Field [Members::Email; Get ( AccountName )] Perform Find [] Show All Records The script appears to be ignoring the Show All Records command as i am still confined to the found set. The script step works flawlessly if it is in a script on its own. If the user were to manually click the Show All Records button, it works without a problem. I know that is an easy work around for the problem but i would like to script as much as i can as the users aren't very computer literate.
March 12, 201015 yr I can't quite see what purpose your script has, but let's deal with the problem. As you have FM Advanced then turn on the script debugger and see what error you are getting on the find request - it may be that the script is stopping.
March 12, 201015 yr Author No errors appear in the script debugger. Prior to this post i was testing the script in IWP, not the FileMaker app. When i launched the database using the app the script runs, but a message comes up saying No records match this set of find requests. What's odd is that the record is actually found in the background (see screenshot). I am logged in with an account name of [email protected] and it finds the record with an email of [email protected], but why does it say no records match the find request?
March 12, 201015 yr Author As for the purpose of the script, perhaps a little background on the project may help clear it up. The database is a member's database of retired NY police officers. Prior to this database, they had another software with all the members in it which only one or two people accessed. Since moving to filemaker, they wanted the members to be able to access the database and have permissions to edit only their own record. After having the database up for 2-3 weeks i was constantly getting emails saying when they opened the database they were not presented with their own record. So i took the approach of having the opening layout be a kind of search portal which search boxes for name, email, etc... I even wrote a short user manual walking the end user through searches. This prompted more emails saying that once they searched for their record they couldnt see everyone's record again. I then removed the status toolbar altogether and setup some basic navigation buttons again with instructions but that did not help any. My last step was to setup a script that would automatically bring them to their record which is where i'm at now. I originally setup the script to search their record but it became a problem for the user because unless they clicked Show All Records, they were locked to the found set, hense the need for the script to have the Show All Records step.
March 12, 201015 yr What's odd is that the record is actually found in the background (see screenshot). Hi. Looking at the screenshot, what I see in the background is not a "found record" ... it's the same window still in Find Mode, waiting for the search to be modified. I think the problems regards use of the "@" symbol in the search string. The "@" symbol plays a special role in FM Finds, where it represents "one character." To allow the "@" symbol to be included in a search, it will need to be preceded by an "escape" character, the "" key. See, Link Hope it helps.
March 12, 201015 yr Author question is how can i use an "escape" character as i am setting the email field in the search with Get ( AccountName ) Would i do something like: "Get( AccountName)"?
March 12, 201015 yr Enter Find Mode [ ] Set Field [ Email; Substitute ( Get ( AccountName ); "@"; "@" ) ] Perform Find [ ]
March 12, 201015 yr Author I will give that a try. Thank you all for your help, it is much appreciated.
March 12, 201015 yr Seems like this would be better solved and more easily solved with privilege sets. That positively prevents people from seeing other records. Then the only thing you have to do is modify the "Find All" menu choice so that it connects to a script, and the script does a find for "*" in a field like record ID (indexed field with a value in every record). All other more specific finds will only find allowed records.
Create an account or sign in to comment