Jump to content

Hide toolbar on startup based on privilege set for all layouts


amerioca
 Share

This topic is 2916 days old. Please don't post here. Open a new topic instead.

Recommended Posts

 Iam 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] Else Show/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)]

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

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

End If Show All Records Go 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.

Link to comment
Share on other sites

If [Get ( AccountPrivilegeSetName ) = "Operations"]
    Show/Hide Toolbars [Lock; Hide] 
Else 
    Show/Hide Toolbars [Show] 
End If

Should do it.

 

It's not clear what happens later on in your script. IE what is the script "(0831) Map Start Up" actually doing?

 

(Next time try to display your script as in the script editor)

Link to comment
Share on other sites

This topic is 2916 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.