What you have shown should work to set the local variable to the account name of the current user. Since it's a local variable, how do you know if it is being set to the wrong value?
The script builds a Filename from a defined path & Get(AccountName) & ".jpg" which refers to a file containing an image of the signature for the current user which is then added to a layout and then printed.
A user Andrew logs on and the document is printed with his sgnature. User Chris logs on and the document is pronted with Andrew's signature and not his.
Get ( AccountName ) is reliable. I've used it a lot and their haven't been any bug reports in Report an Issue posted referring to Get ( accountName ). If I were you, I'd take a careful look at the script and how you use that file path to access your image file to see if something might not be set up right.
One way to immediately check the value of $Localvariable immediately after you assign a value to it (if you do not have FileMaker Advanced and it's data viewer), is to add a Show Custom Dialot immediately after the Set Variable step to show the value of the variable.
OK. I'll make a diary note to do just that next time I am on site with the customer (I haven't been able to make it go wrong here).
Please note that options such as Server Side Authentication and the Mac OS KeyChain can result in being logged into a database under a different account name than the user expects.
Thanks for that.
We're not using Server Side Authentication and this is a Windows environment so I don't believe either of those caveats apply in this case (they either or both might in others)
Those were just a few examples. There are other ways that a file can be opened in a different account name than expected. Some other sources of confusion:
FileMaker has both User Names and Account Names. These are not the same thing though they can be identical for a given file open on a given computer. A User Name is specified for the application/computer user account in preferences. An Account Name is specified in manage security. And just to confuse things further, when the standard password dialog appears, FileMaker enters the User Name as the Account Name.
Also, file options can be set to enter account names and passwords automatically so if you have a multi-file system, the value returned by Get ( accountName ) can be the user's account name in one file and a different account name when they open a window in a different file that auto-entered the log in credentials.