5 Replies Latest reply on Nov 18, 2013 7:11 AM by philmodjunk

    Tab control access using account name

    SamThomas

      Title

      Tab control access using account name

      Post

           Suppose there are two account one is Admin and another one is Super admin.both share one common layout in when there two tabs.Now is user is Super admin then he can access Tab B and if user is Admin then when click on Tab B nthg is shown means no acces. I dont want to make diff layout for both.Because in actual app there are so many users.So can we control Tab using account name ?

        • 1. Re: Tab control access using account name
          philmodjunk

               In FileMaker 12 there are new script triggers for working with tab controls not found in older versions. What version of FileMaker are you using?

          • 2. Re: Tab control access using account name
            SamThomas

                 I m working with Filemaker pro 12 advance.But I know about the trigger but I dont know how to restricted any tab from user.

                 I want ..If account name=sam then u can VIew tab C otherewise it has to redirect on (Go to object)tab a.

            • 3. Re: Tab control access using account name
              philmodjunk

                   Yes but now that I know that you are using FileMaker 12, I can answer using features that would not help you if you were using an older version. My answer would be different if you told me that you were using an older version.

                   Assuming that the second tab panel is the panel for which you want to have limited access, the OnTabSwitch trigger can perform this code:

                   If [ ( Get ( AccountName ) = "Admin" ) and ( GetValue ( Get ( TriggerTargetTabPanel ) ; 1 ) = 2 ) //access is not permitted ]
                      Exit Script [False]
                   End If

                   Since this trigger performs the script before the triggering event is processed, Exit Script [False] will cancel the triggering event (The click on the tab panel) and the tab panel is not selected.

              • 4. Re: Tab control access using account name
                SamThomas

                     Thanks For reply its working 

                     What I did ...

                If [ ( Get ( AccountName ) = "Admin" ) and ( GetValue ( Get ( TriggerTargetTabPanel ) ; 1 ) = 2 ) //access is not permitted ]
                   Go To Object [Object Name :0]  //default tab
                End If

                     But here its goes to default tab but then come back to tab 1

                • 5. Re: Tab control access using account name
                  philmodjunk

                       I have assumed that you have a two tab panel tab control with tab 1 as the default tab panel and tab 2 having restricted access.

                       From just the script steps shown, there shouldn't be any change in tab panels when you click the restricted tab without sufficient permission. (And you may want to use ≠ "Super Admin" instead of = "admin" so that this works for more than two accounts.)

                       But if necessary, you can give tab panels object names and use Go to Object to select a particular panel in a script.

                       Please describe your tab control in more detail.