Thank you for the the response. I have created this script from the info you have given me and it does work. It seems very simple. I would just like to have it checked to make sure it is secure/good enough to place on a live database.
Set Error Capture [ On ]
If [ Get ( AccountName ) = "admin" ]
Go to Layout [ “newsPortal” (newsPortal) ]
Go to Layout [ “home” (home) ]
Please let me know what needs to be modified. Thank you in advance.
What version are you using?
11 pro advance
You do not have to create a second layout for this.
If you are using 11 you can do simply the following:
- Create a 1 line portal with no line, pen patterns, etc.
- Put the button in the portal.
- Put on a portal filter of: Get ( AccountPrivilegeSetName ) = "AdminGroup" ( Use account name if you are checking for specific account name ).
Here is an example of the modernized visiblity trick.
Thank you for the response Mr. Vodka. When i create the portal and add the button, i can see the button in browse mode. When i add the filter the button disappears. It is clickable but completely invisible to all users. If i click on the invisible button as admin group it takes me to the data entry page, if i click on it as non admin it takes me to the no access page which it would do normally. I am able to replicate LaRetta's example with no problem. When I add the code: not IsEmpty (visable11 2::text1 ) & Get ( AccountPrivilegeSetName ) = "Admin" I loose the fuctionality of the field. The
not IsEmpty (visable11 2::text1 ) is Laretta's original code and it does work when it is alone. It seems that you have to use some sort of a field in the portal such as a text field(date field) and not a button. I am still learning Filemaker so alot of my scripting is trial and error and It seems to me that I am doing something very wrong with the button and the Get ( AccountPrivilegeSetName ) = "Admin" filter. I am not asking to be spoon fed here but I can not get it to work.
All you need is: Get ( AccountPrivilegeSetName ) = "AdminGroup".
You do not need the not IsEmpty (visable11 2::text1 )
If the filtered porta; does not have anything to show, the button itself will go away if it is indeed within the boundaries of the portal.
not IsEmpty (visable11 2::text1 ) & Get ( AccountPrivilegeSetName ) = "Admin" will be true if either of those statements are true because you are using a &, which is a concatenation instead of the logical operator of AND.
So if visable11 2::text1 is not empty but the priv set is Read only then the equation will result in the following:
1 & 0, which is 10, and in boolean logic TRUE.
As opposed to using AND which will result in 1 AND 0, which is FALSE as both are not true in boolean logic.
I just can not get it to work. Sorry to keep this going but Its driving me crazy. When i use a text field I have no problems. Here are some images so you can see my work. The first one is the relationship, the second is the filter and the portal setup and the third is the no button in the browse mode. I do have an account at fmforums if you would like to see my file.
Sure you can send me a Private message on fmforums with a copy of the file but I have a feeling that your Privilege set name is not "Admin". I have a feeling that your user account may be that but that your privilege set may be [Full Access].
It works, I was trying to set by user and not privilege set. You were correct!! So stupid on my part!! Thank you for your help.