Try a "Case"
Get ( AccountPrivilegeSetName ) = "[Full Access]" ; 0 ;
Get ( AccountPrivilegeSetName ) = "[Wholesale Users]" ; 0 ;
1 // default to HIDE if the others are not above )
This is flexible for you to add more "false" tests as needed. Otherwise it will be "true" and HIDE the object.
Try using or instead of and. A user can't be both full access and a wholesale user no?
What you have posted shouldn't crash the program. I'd look for other causes such as a damaged file. Try recovering it to see what is reported by the recover process.
I do question the [ ] used with the Wholesale Users privilege set name. That won't be correct unless you explicitly entered those brackets as part of the privilege set name. Only the built in [Full Access] privilege set normally has those brackets.
Thank you.... when I did a recovery nothing showed up as a problem. I also put the brackets around the [Wholesale Users] privilege set. I knew pretty much nothing when I started programming so I just copied the [Full Access].
My problem is solved with
Get ( AccountPrivilegeSetName ) = "[Retail Users]" or Get ( AccountName ) = "Store"
However the application still crashes in Layout mode. This button is part of a button bar and the code above is attached to the Hide Object When property in the inspector.
Not sure what the issue is
My first thought, too, and then opted for the flexiblitly of the Case() - easier to add other conditions to NOT hide the object.
Sent from my iPad