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.
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.
I believe you'd need to set up privilege sets to correspond to your groups and then use Get(CurrentPrivilegeSetName).
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.