Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi all, I have a simple script to produce escalation notices based on the user and a time since last run but the blasted thing won't execute. What am I doing wrong ?

With debugger the script exits at the first If statement when I am logged on as Sid.

 

Screenshot of the script is attached

 

post-61505-0-73757700-1382675302_thumb.p

Posted

Perhaps "Sid" is your account name used to login, which matches the account setup in FileMaker security (or LDAP/AD)? If so, change the function to Get ( AccountName) instead.

 

- - Scott

Posted

Perhaps "Sid" is your account name used to login, which matches the account setup in FileMaker security (or LDAP/AD)? If so, change the function to Get ( AccountName) instead.

 

- - Scott

I knew I would be doing something stupid, thank you that was indeed the error 

Posted

Your first step's syntax is incorrect. The expression ("Sid" or "Claire") will always resolve to 0, and so you will always exit the script  regardless of what Get(Username) resolves to (unless you have a user named "0").

 

Make your script

If[Get(Username) = "Sid" or Get(Username) = "Claire"]
//Then insert the rest of your script.
//Then add
Else
Exit Script
End If

EDIT: or Get(AccountName), as the case may be

Posted

Thank you doughemi, Get(Accountname) resolved the issue. As a matter of interest what is the functional difference between Username and AccountName

Posted

Per the FM functions reference:

 

Get(UserName): The name of the FileMaker Pro user, as specified in the General tab of the Preferences dialog box.
 
I recommend to my users that they choose "Other:" in the General tab and input their login name to make logging in to the database easier. Otherwise, the default User Name is usually the System Name - the user name setup on your computer (Users & Groups Preference Panel on Mac OS X).
 
- - Scott
Posted

See:

http://www.filemaker.com/11help/html/func_ref2.32.83.html#1041385

http://www.filemaker.com/11help/html/func_ref2.32.3.html#1052203

 

IMHO, you shouldn't be using either. Instead, assign Sid and Claire to a higher privilege set and deny other users access to the script in their privilege set.

 

Why is that preferable to just using the account log in credentials to run the script ?

Posted

Because some day Sid will be replaced by Nancy and then you will have to modify this script - and all other scripts and calculations that mention "Sid" by name. Instead of just promoting Nancy to the higher privilege set and let her inherit all the associated privileges automatically.

  • Like 1
Posted

That makes perfect sense, thank you. So I just change the user privileges for anybody else to not be able to run that particular script.

Posted

FYI:

 

Comment's recommendation is right on. With respect to [FULL ACCESS] privileges, I don't allow a directory group (external authentication) to have such a high level of privileges (per Mr. Blackwell's security recommendations). I have FileMaker-only accounts for FULL ACCESS, but don't have an external "Admin" group.

 

I also use Matt Petrowsky's "developer" custom function to enable developer-only (FULL ACCESS) functionality. This can be obtained from the Starter example file at filemakerstandards.org, or their GitHub repository.

 

- - Scott

Posted

I don't allow any user full access privileges full stop. I don't want them accessing layout or definitions under any circumstances. I will look at the Matt Petrowsky file you recommend, what is it's function ?

 

Back to the script it is now not working correctly.

If I use the original step; 

Get ( AccountName ) ≠ "Sid" or "Claire"

and I log in as Sid the script executes but not if I log in as Clair. If I change the script to:

Get ( AccountName ) ≠ "Sid" or Get ( AccountName ) ≠ "Claire"

it doesn't execute and exits at the first If step.

Posted

Get ( AccountName ) ≠ "Sid" or Get ( AccountName ) ≠ "Claire"

 

is always true. You want to use either:

 

Get ( AccountName ) ≠ "Sid" and Get ( AccountName ) ≠ "Claire"

 

or the opposite:

 

Get ( AccountName ) = "Sid" or Get ( AccountName ) = "Claire"

 

as your test.

Posted

Thank you comment, now I have found out why it didn't work I can throw it away and move to your excellent suggestion of attaching the script to a privilege set.

This topic is 4046 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
×
×
  • Create New...

Important Information

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