May 21, 200817 yr 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.
May 21, 200817 yr 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
May 21, 200817 yr Author 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.
May 21, 200817 yr 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.
May 21, 200817 yr 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
May 21, 200817 yr Author 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.
May 22, 200817 yr Author 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?
May 22, 200817 yr 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.
Create an account or sign in to comment