Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Script: change username in Runtime Solution

Featured Replies

Hi,

 

I have a runtime solution with 2 accounts: admin and a user account.

Now I would like to give the user the possibility to change the username within the runtime solution.

 

I managed to change the password with a script but not the username.

I tried to save the new username in a global field an then overwrite the username with the script step but it doesn't work properly.

 

Thanks for your help

Regards

Let's be clear what we're discussing here: the User Name or the Account name.  There is a difference. The Account Name is what is coupled with the password and is what a user would supply along with the password to authenticate for access to the file at some specific level of privileges.  

 

The User Name is something that comes from the application preferences; it has no real bearing on or connection to authentication features.  Sometimes the User Name will automatically display in the credentials dialog box however.  So, unless it also is the Account Name, it has to be cleared and the correct Account Name entered.

 

The scripted Account Management features allow for deleting and adding Accounts.  So, if you want to "...change..." the Account Name, first delete the old one and then replace it by adding the new one.  You will want to furnish credentials for the new Account as part of this process.

 

Steven

  • Author

Ok you are right, my mistake. We are discussing about changing an account name.

 

I tried the scriptstep: delete account (get(accountname)) but it didn't work. I think I can't delete an account which is in use. But to delete an other one I have to know the existing account names.

 

Is there a nice possibility to list all the accounts? I'm asking because the "security Option"where you can add and delete accounts in the menu doesn't exist in a runtime solution. But I would like to give the user a similar option.

 

Thx a lot for your help

Your script will likely need run with Full Access Privileges - there's a check box in the bottom left in the script editor.

 

Incidentally, create the new account before deleting the old one.

  • Author

Thx first problem solved.

 

second problem: I have a 2 file solution (separated model)! Changing the account name will affect only one of both.

Is there another solution to change also the accountname of the other file without using hidden windows?

Or better is there not a possibilty to give Filemaker a sort of system access for the second file without a direct access for the user?

 

I couldn't find an option to tell Filemaker to open the second file with a special accountname and password

Since these are runtime files, you can't use External Server Authentication which specifically addresses the multi-file issue.

However you can call a script in the data file from the UI file and create a new Account. You'd pass the Account Name and password as parameters from the calling script to the script in the data file. All should run with the Run script with full access privileges option checked.

You probably should do some elementary error trapping to be sure these scripted Account changes actually occur as intended.

Steven

In my experience, weird things happen when a file is open with an account that has been deleted. If the file has been opened with the account that is about to be changed then it's probably best done in this order:

 

create new account

re-login to new account

delete old account

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.