dbTalk Databases Forums  

opening script with privilege set branching?

comp.databases.filemaker comp.databases.filemaker


Discuss opening script with privilege set branching? in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
lansingoogle
 
Posts: n/a

Default opening script with privilege set branching? - 03-26-2007 , 11:00 AM






I've been trying to implement a script that runs when a file is
opened, which will navigate to different layouts depending on the
privilege set of the user. I can't get it to work, FM doesn't seem to
recognize my use of the get(PrivilegeSetName) function as a boolean
condition. What am I doing wrong? or is there another way to branch a
script depending on privilege set... (Data viewer shows that the
privilege set is updating correctly, it's just not being recognized in
the script, I guess?)

thanks
Lanse
FM8 Advanced, Mac


Reply With Quote
  #2  
Old   
Grip
 
Posts: n/a

Default Re: opening script with privilege set branching? - 03-26-2007 , 12:48 PM






On Mar 26, 10:00 am, "lansingoogle" <filema... (AT) jillo (DOT) com> wrote:
Quote:
I've been trying to implement a script that runs when a file is
opened, which will navigate to different layouts depending on the
privilege set of the user. I can't get it to work, FM doesn't seem to
recognize my use of the get(PrivilegeSetName) function as a boolean
condition. What am I doing wrong? or is there another way to branch a
script depending on privilege set... (Data viewer shows that the
privilege set is updating correctly, it's just not being recognized in
the script, I guess?)

thanks
Lanse
FM8 Advanced, Mac
Get(PrivilegeSetName) returns the text name of the privilege set, so
unless you've got numbers in your privilege set name, an
If[Get(PrivilegeSetName)] always returns false. Try
If[Get(PrivilegeSetName) = YourPrivilegeSetName]

G



Reply With Quote
  #3  
Old   
Matt Wills
 
Posts: n/a

Default Re: opening script with privilege set branching? - 03-26-2007 , 12:54 PM





On 03/26/2007 12:00:01 "lansingoogle" <filemaker (AT) jillo (DOT) com> wrote:

Quote:
I've been trying to implement a script that runs when a file is opened,
which will navigate to different layouts depending on the privilege set of
the user. I can't get it to work, FM doesn't seem to recognize my use of
the get(PrivilegeSetName) function as a boolean condition. What am I
doing wrong?
Just one thing. Well, maybe two.

1. Get ( PrivilegeSetName ) is the actual name of the Privilege Set, not a Boolean 1 or 0.

2. Note in the Data Viewer that the name of the set is encased in square brackets, as below.

The process works fine for me.

Create as many evaluations as necessary, and you should achieve your goal.

Brute force method :

If [ Get ( PrivilegeSetName ) = "[Full Access]"
Go To Layout [ Whatever ]
End If

or, a bit more elegantly:

Go To Layout [ either name or number based on calculation ] in which you could then create a calc using a single Case statement to handle branching instead of multiple Ifs.

Matt


Reply With Quote
  #4  
Old   
lansingoogle
 
Posts: n/a

Default Re: opening script with privilege set branching? - 03-27-2007 , 11:09 AM



On Mar 26, 1:54 pm, Matt Wills <I... (AT) witz (DOT) end> wrote:
Quote:
On 03/26/2007 12:00:01 "lansingoogle" <filema... (AT) jillo (DOT) com> wrote:

I've been trying to implement a script that runs when a file is opened,
which will navigate to different layouts depending on the privilege set of
the user. I can't get it to work, FM doesn't seem to recognize my use of
the get(PrivilegeSetName) function as a boolean condition. What am I
doing wrong?

Just one thing. Well, maybe two.

1. Get ( PrivilegeSetName ) is the actual name of the Privilege Set, not a Boolean 1 or 0.

2. Note in the Data Viewer that the name of the set is encased in square brackets, as below.

The process works fine for me.

Create as many evaluations as necessary, and you should achieve your goal.

Brute force method :

If [ Get ( PrivilegeSetName ) = "[Full Access]"
Go To Layout [ Whatever ]
End If

or, a bit more elegantly:

Go To Layout [ either name or number based on calculation ] in which you could then create a calc using a single Case statement to handle branching instead of multiple Ifs.

Matt
Thanks Matt and Grip for your advice on this issue. For the record, I
did have boolean expressions built into my If( ) statements, i.e.: If
( GetPrivilegeSetName) = "name of a privilege set".

What I discovered was that if I used Get(AccountName) instead of
PrivilegeSet it worked perfectly. Then I realized that I had "Run
script with Full Access privileges" checked for my opening script, and
that this was over-riding the signed-on privilege set, so that set-
dependant conditions were never getting called. I felt a bit foolish
to have ignored that possibility, but I'm wiser now and happy that it
works.
Thanks again,
Lanse



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.