Jed69 Posted May 21, 2008 Posted May 21, 2008 I have a portal in a layout. The layout only has one record and I related the table to a global field in the table for the portal so it currently shows all records in that table. What I want it to do is when the layout is opened it will filter the portal's records to be only when the staff field is the same as the logged in account (using a get function). Is there a way to filter the portal records like this or should I give up and put this data in a separate window.
Søren Dyhr Posted May 21, 2008 Posted May 21, 2008 Beyond not necessarily having to be in a global, could you in the initial script set the key value to the desired value as a condition. http://www.filemaker.com/help/FunctionsRef-250.html --sd
Jed69 Posted May 21, 2008 Author Posted May 21, 2008 I see where you are coming from, I hadn't thought about that. The only problem is this database is being accessed by multiple users via Filemaker server.
comment Posted May 21, 2008 Posted May 21, 2008 Why don't you define an unstored calculation field = Get (AccountName) then define the relationship as matching this field to the Staff field in the related table. The same could be achieved by using a global field instead of the calculation field, and having a startup script set the global to Get (AccountName) - I believe that's what Søren meant.
Søren Dyhr Posted May 21, 2008 Posted May 21, 2008 Ok! thats right it then needs to be a global field out of reach for the user, which get set by the init script, unless you change the relation to have the userprivileges as a unstored field on primary side, following the rendering ... and hardwired on the foreignkey side. --sd
Jed69 Posted May 21, 2008 Author Posted May 21, 2008 Thank you both, I seem to have it working. I need to test it in a multi user environment but it all looks promising. Thank you again.
Jed69 Posted May 22, 2008 Author Posted May 22, 2008 Tried it on a network and it works. The next problem I have is I would like this portal to also filter on one other field. The records in a portal are ToDo items and when they are done a date filed is filled in to show they have been completed. It would be great to only show the items not completed (ie items in which the date_done field is blank) I have ordered the records so that the blank ones appear at the top and I can conditional format them to make them clear, but it would be nice just to have only the relevant records. Is there a way to do it?
comment Posted May 22, 2008 Posted May 22, 2008 You could define a calculation field in in the ToDo table = Case ( not DateCompleted ; Staff ) and use this field for the relationship instead of the Staff field.
Recommended Posts
This topic is 6027 days old. Please don't post here. Open a new topic instead.
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