2 Replies Latest reply on Dec 13, 2014 8:52 AM by philmodjunk

    Hiding toolbars on startup based on privilege set.



      Hiding toolbars on startup based on privilege set.


      I am certainly not a professional filemaker developer but try to work around problems (problems for me not for the pros) but this easy thing here drives me nuts. I am trying to hide the toolbar for all layouts (about 80) based on privilege set. I have placed an opening script in the File Options but what it does, it only hides the toolbar for the first/opeing layout not for the rest. Any tipps here are most welcome. Merry x- mas for all 


      Opening script

      Allow User Abort [Off]

      Set Error Capture [On]

      Perform Script[“hide toolbar test”] -script supposed to hide tool bars for all layouts (If [Get ( AccountPrivilegeSetName ) ="Operations" Show/Hide Toolbars [Lock; Hide] ElseShow/Hide Toolbars [Show] End If

      #---------File Opens on L000_Opening Window to speed up the open process.#-------------by not loading any screens and images and then performs this Startup Script#

      Freeze Window##--------------------------------------Checks Staff Account for UserName#

      Go to Layout [“L131_STAFF_List_View” (T17_STAFF)]

      Enter Find Mode [ ]

      Set Field [T17_STAFF::FileMaker_Account; Get(AccountName)]

      Perform Find [ ] #If [Get(FoundCount) = 1] Set Variable [$$Name; Value:Get(AccountName)]

      Set Variable [$$CalendarFilter; Value:Get(AccountName)]

      ElseSet Variable [$$Name; Value:Get(UserName)]

      Set Variable [$$CalendarFilter; Value:"-All Users-"]

      End IfShow All RecordsGo to Layout [“L0_Opening Window” (T14_PREFERENCES)]

      Set Field [T14_PREFERENCES::g_Name; $$Name]

      #-------------------------------------- Set initial Session Globals for Invoice Line Item Management

      Set Field [T12_INVOICES::g_Search; ""]

      Set Field [T12_INVOICES::g_Product Category Filter Popover; "Product"]

      Freeze Window##--------------------------------------If the PatternCount = "Pro" - Desktop#

      If [PatternCount ( Get ( ApplicationVersion ) ; "Pro" ) = 1]

      Set Variable [$$Device_Mode; Value:"Pro"]

      Go to Layout [“L1_Home” (T14_PREFERENCES)]

      Adjust Window [Resize to Fit]

      Move/Resize Window [ Current Window; Top:(Get ( WindowDesktopHeight ) / 4) - (Get ( WindowContentHeight )/4); Left: (Get ( WindowDesktopWidth ) / 2) - (Get ( WindowContentWidth ) / 2)] Perform Script [“ (0831) Map Start Up”]

      #End If##--------------------------------------Sets the window title as the name of the file...


      [ Current Window; New Title:Get (FileName)]

      Set Window Title##--------------------------------------Performs a check to see if this is the first time the file is being opened...If [T14_PREFERENCES::flag_first_start_needed = 1] Set Field [T14_PREFERENCES::flag_first_start_needed; 0]