Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

Is there a variable that holds the current user...???


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

Recommended Posts

Posted

I do most of my scripting with ASP and just populate fields back in filemaker at the end. To fire these scripts I attach it to a button that simply uses Open URL and attaches any values from Filemaker I need as querystrings to the URL.

Is there a variable for current user I can use to also attach the current user's name as a querystring value with the URL?

Any info would be greatly appreciated. Thanks!

Posted

get(accountname)

You're in FM right? And you're sending FM data in the URL to your ASP pages, correct? Then that should work.

As an aside: are you using the old ASP or ASP.NET?

Posted

That actually returned the username that I've logged into Filemaker with, which in this case is admin. What I need is the value of User name that you put into the Preferences in Filemaker. Right now my actual name is there. That's the value I need.

Posted (edited)

a username is stored in the windows registry.

The following is a windows script that sets the username for filemaker 8 (will need to be adjusted for other versions) Just copy the following text to any text editer and save as "yourfilename.vbs".

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegWrite ("HKEY_CURRENT_USERSoftwareFileMakerFileMaker Pro8.0PreferencesUser Name"),WScript.Arguments(0),"REG_SZ"

WshShell.Popup "Your Username has been set to " + WScript.Arguments(0),10

this can be run from filemaker using a send event.

Do it by calculation where the calulation is:

"C:yourpathyourfilename.vbs " & Quote (FieldValue or Variable you define)

this will set the username to whatever you define but filemaker will not reconize the change until the next time filemaker is opened.

Edited by Guest
Posted

this will set the username to whatever you define but filemaker will not reconize the change until the next time filemaker is opened.

2 ways around that:

- make a similar VBscript part of the Windodws logon script. instead of taking an argument, have it read the current Windows user name. (This is great for Terminal Services deployments for instance)

or

- make a pseudo filemaker shortcut that actually launches a VBscript instead of FM. The VBscript reads the Windows user name, writes it to the registry and then launches filemaker

This topic is 6737 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.