March 5, 201015 yr Im having trouble with a script that needs to run onLayoutLoad. I have a member's database that i am starting to setup users in. Each user's username is their email address. Each user also has a record in the database. What i would like to do is once the user logs in, have the database open up to their record. I've tried to setup a script that would Perform Find or Enter Find Mode, but it seems i cannot use the Get functions. For eaxmple, what i've tried to setup is a script that would look like the following: Members::Email = Get ( AccountName ) Problem is when i use the specify find requests, it actually searches for an email address of Get ( AccountName ). Hoping someone could point me in the right direction. Thanks
March 5, 201015 yr You need to use: Go to Layout (Members) Enter Find Mode Set Field [ Members::Email ; Get (AccountName)] Perform Find There might be issues with the @ character in a find, since that is a special use character in Find. You'll need to escape it. And so, perhaps you shouldn't have their account = their email address. Just have their email address as part of their User record, as is AccountName. Edited March 5, 201015 yr by Guest
March 6, 201015 yr Author Thank you for your assistance. One last question. I setup a button to run the script to temporarily test the function and i would like to take it a step futher. Once their record is brought up, i would like to switch them back to browse mode and have all records available. I setup my script as so: Enter Find Mode [] Set Field [Members::Email; Get ( AccountName )] Perform Find [] Enter Browse Mode [] Show All Records I've also tried: Enter Find Mode [] Set Field [Members::Email; Get ( AccountName )] Perform Find [] Show All Records It seems as if the user is still locked into their record until the phycially click the Show All Records button. Do i have this scripted wrong or is this something FileMaker cannot do? I should also mention that this database is primarily used in IWP. Thanks
March 6, 201015 yr Users are automatically in Browse mode after Perform Find. If you Show All Records, then you've defeated your purpose. I'm not very familiar with IWP, so I can't say what will not work using IWP. Perhaps using Extend Find will allow you to bring back the other records, while still maintaining the found record as the current record.
March 6, 201015 yr Author Perhaps im wrong but if i were to manually search for a record and then click the show all records button, i would still be looking at the record i searched for but would no longer be bound to the search criteria. This is what i am trying to accomplish. The only reason i am trying to setup this script is due to the fact that the people using it are not very computer savy and when they login they are expecting to see their own record. I've written a tutorial as to how to search for their own record but i still get at least 5 emails a day from people asking why when they open the database is brings them to the first record and not theirs. Just trying to make it as easy as possible for the end user.
March 6, 201015 yr Oh, of course, you are right. The current record would not change if you add Show All Records after the Perform Find. What do you mean that they are "locked"? The found set hasn't changed?
March 6, 201015 yr Author Correct, they are locked into the found set. If i click the previous or next record buttons i am unable to go to other records. If i manually click Show All Records i am able to browse other records, i would just like to be able to have this done automatically as i know the end user wont know what to do.
March 6, 201015 yr I don't see why your script isn't working. Sorry. Does anyone else? By the way, rereading your original post, you mention that you've assigned this script as an onLayoutLoad trigger. I don't see the need for that. Just put it in the Open Script. Edited March 6, 201015 yr by Guest
Create an account or sign in to comment