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.

Server Hosted File connecting to Local File?

Featured Replies

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.

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

  • Author

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?

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.

  • Author

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!

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.