4 Replies Latest reply on May 11, 2010 2:24 PM by wkparkjoe

    IWP and Scripting Question



      IWP and Scripting Question




      I am working on a database where I have multiple users from multiple departments accessing and entering in specific information. Without getting too involved, I am restricting view/edit/delete access to their own specific files (either on a Get (AccountName) or another field such as department id, etc). Now the primary access for all users is IWP as it was most cost effective than giving everyone a copy of FMP. My problem is that I want to script so that when they log in and pull up the view they will see only their records as well as only be able to edit/view/delete their records and not everyone elses.


      The permissions are set properly and work just fine. Now all I want to do is do a constraint find set so that when they load up the layout it will only display their records and skip all the << NO ACCESS >> records.


      Can I put a OnFirstWindowOpen script trigger to execute on login of the user from IWP? If not, can I do an OnLayoutLoad instead? Finally if neither work, does anyone have a decent work around for restricting record access and display for IWP?


      I am using FileMaker Pro 10 and FileMaker Server Advanced 10. Thank you.

        • 1. Re: IWP and Scripting Question

          Security works the same in IWP. The OnFirstWindowOpen script trigger is just the script that you've specified in File Options to run when the file first opens. So yes, you can do that. (You can also use OnLayoutLoad, but only if a script sent you to the layout. Script triggers in IWP do not trigger from user actions, only from scripts.)


          The command that trips people up is Find All, which does what it says, resulting in "No access" records in the found set. Instead, perform a find with ">0" or "*" in the ID field and it will only find records where the user has access.

          • 2. Re: IWP and Scripting Question

            Hi Tom,

            Thanks for the reply. That works out perfectly. I have a button set to simply rerun my startup script that is called "Find All" even though it's not doing a find all. I wasn't sure but now it makes sense.


            On another topic, is there a Get function for getting the external account group? I want to make the script a bit easier by being based off of group instead of specific domain account name.

            • 3. Re: IWP and Scripting Question

              I believe you'd need to set up privilege sets to correspond to your groups and then use Get(CurrentPrivilegeSetName).

              • 4. Re: IWP and Scripting Question

                Hey Tom,

                Thanks again for the response. I did just that. One thing of note according to the help file on the Get ( PrivilegeSetName ) function, if the script is set to run as admin, the function will report [ Full Access ] instead of the privilege set the user's group belongs to. Thank you again for all your help. I'm using a button to do a show all that will take the user back to view only their group of records.