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

Server Hosted File connecting to Local File?


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

Recommended Posts

Posted

Is there a way for a server based FM file to connect (run a script) in a file stored locally on a computer?

I have a filemaker database on a FileMaker 9 Advanced Server, and created a "launch file" for users to put on their local machines.

My idea was the following: upon first login the user personalizes his copy of the launch file: username and password are stored in a field. He can then connect without having to type his information every time. The information is transmitted to the server-based file, which contains and manages user accounts, redirects, etc.

This would allow me have one and the same launch file for all users/clients using the system.

The problem is that I don't know the file-path in advance... It is only known, once the user placed the launch-file on his machine. I tried to work with variables in the External Data Sources dialog box, but that's not accepted.

Has anyone an idea for a workaround?

Thank you,

Mike

To be clear again, here are my steps:

1. launch file is opened

2. launch file opens SERVER based file with log-in screen and user accounts

3. User enters his username and password, clicks checkbox "remember login info"

4. username and password are verified and this information should now be routed back to LOCAL launch file for automation of login.

Posted

You should rely on script results rather than trying to create a file reference (which won't work). Here's what your scripts should do:

LF = Launch file

SF = Server file

LF: Open Server file

SF: Open with unprivileged account

SF: Use custom dialog to prompt for user credentials (captured in global fields)

SF: Store username and password in variables; clear global fields

SF: Use credentials to authenticate to the file (using the ReLogin script step)

SF: If successful return username and password (using the Exit Script script step)

LF: Parse script result returned from Get ( ScriptResult ) function

LF: Store user credentials in local file

Posted

thank you for your comment. It's all clear to me, except the last step.

I can't store the filepath of the LF in the SF, because it is not known in advance. How does the SF find the LF?

Posted

The SF doesn't find the LF - the script in the LF is "on hold" having called the script in the SF. An example snippet of such in the LF would be:


....

Perform Script ["Authenticate to file" from file: "serverFile"]

Set Variable [$scriptResult; Value:Get(ScriptResult)]

Set Variable [$accountName; Value:GetValue($scriptResult; 1)]

Set Variable [$password; Value:GetValue($scriptResult; 2)]

....





In the "Authenticate to file: script in the "serverFile" we'll assume the account name and password were captured in the variables "$accountName" and "$password". Your script there would end with something similar to the following:



....

If [ $saveCredentials = False]

  # clear credentials if not saving

  Set Variable[$accountName; ""]

  Set Variable[$password; ""]

End If

Exit Script [Result: $accountName & ¶ & $password]

This allows you to pass a return value back from the script in the SF to the calling script in the LF which then uses those values to continue on with its work.

Posted

Oh..!! Now I feel like an idiot. Or course. If the whole process is managed by the script in the LF (calling scripts in the SF) it all works.

Sometimes I get so lost in detail...

Thank you!

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