Jump to content

Recommended Posts

Posted

Hello,

I'm creating a "mailer" file to send HTML emails from FileMaker without the need for a third-party plugin.  The idea is that whenever another FM app needs to send an email, it can just ball up some JSON and call the "Send Mail" script from the central mailer file with the JSON as the script parameter.

I've read that if the same credential set exists for the logged-in user in both files, opening the secondary file will be transparent.  However, if not, the user is presented with a login dialog.  Since the "Open File" script step is not supported on WebDirect, I can't just detect if the file is open (via the DatabaseNames function) and have the script log in.  Using PSOS still shows the dialog.

Is there any way to run a script from another FM file without the user seeing a login dialog and without needing to duplicate user accounts in the second file?

Posted

Hi comment,

The URL call looks like it would do what I want, but I can't seem to make it go.  I keep getting Error 5: "Command is invalid (for example, a Set Field script step does not have a calculation specified)"

My script step looks like: Insert from URL [With dialog: Off ; Target: $result ; "fmp://my.server.name/HelloTest?script=SayHello" ; Do not automatically encode URL ]

I started with my intended final use, and kept simplifying things when it didn't work.  I have made a simple file (HelloTest) that uses the Guest account, to eliminate possible hangups with login, etc.  I made sure to add the "fmurlscript" extended privilege.  The "SayHello" script just shows a custom dialog.

I tried using the IP address instead of DNS name of the server, with and without the script parameter, etc.  Still only getting Error Code 5.

I found a Google result that said Error 5 used to be a problem with the Insert from URL script step, but that it was fixed in FMS 21.1.1.  I am running FMS 21.1.1.40, so that shouldn't be a problem.  Also, I have several other places where I use Insert from URL to call an API, and they work just fine.  Maybe it's the "fmp://" protocol?  FMPro is not installed on the server, so maybe that protocol isn't registered and causing it to barf.  But it should work when trying to debug locally . . .  🤷‍♂️

Posted

You cannot use the Insert from URL script step for this because it supports only a limited set of protocols and the fmp:// URL scheme is not among them.

You should be able to use the Open URL script step.

 

  • 2 weeks later...
Posted

I did get the fmp:// scheme to work using the Open URL script step.  Wasn't even aware of that one.  I thought Insert from URL was the only way to use cURL.  Turned out not to be the behavior I was after, though.

The Data API is just the ticket.  Took a bit to get the hang of, but it works!

Thank you for your help!

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.