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

Script: change username in Runtime Solution


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

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted

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.

Posted

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

Posted

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

Posted

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

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