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

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

Recommended Posts

Posted

Hi everyone,

I'm trying to get attaching files go mails generated using FM17 to work. The idea is to attach a variable file to a mail-message generated for a specific record. The filename for the attachment is specific to the record and I've got a field that generates that filename (fileNamejpg01).

I'm using the send mail option in a script (which is working) and the option to attach a file by giving a file path. That file path looks like this:
file:../../../Desktop/werkmap/Beeldmateriaal/instagram/$fileNamejpg01 

The variable part is "$fileNamejpg01" and I'm sure I'm doing something really dumb ... but don't find anything that solves the problem (or that I at least understand).

Hope someone can help!

Thanks, Peter

Posted

The file path window and what you feed it is not a calculation window so you have to calc the path ahead of time and feed it the resulting variable

Set Variable[ $path ; Get(DesktopPath) & "werkmap/Beeldmateriaal/instagram/" & $fileNamejpg01 ]

Posted
18 hours ago, Wim Decorte said:

The file path window and what you feed it is not a calculation window so you have to calc the path ahead of time and feed it the resulting variable

Set Variable[ $path ; Get(DesktopPath) & "werkmap/Beeldmateriaal/instagram/" & $fileNamejpg01 ]

I'm staring blindly at a screen now after trying again ... I'll give it a rest until tomorrow and I'll let you know if I've gotten it to work Wim!

Posted

I'm lost ...

I've added two screenshots of what I have now but I can't get it to work. Been trying different options of all I could think of but not getting anywhere. 

Hope you can make sense of it Wim. It's probably something really dumb I've done but it would help a lot if I get to understand it and get it to work!

Thanks!

1.png

2.png

Posted

No, that last window is not a calculation dialog.  The only thing you should have there is:

 

$path

The $path variable needs to be set in your script before you get to the Send Mail script step

Posted

Thanks for you patience Wim!

I got it to work and cleaned up my folder structure a bit to make the whole think a bit more clean and simpel while I was at it. It makes the path-calculation a lot easier.

For future reference if people are looking for a similar solution I've included the screenshots of my results:
1. The window that will send the mail
2. The window that calculates the path to the image file
3. The entire script to get it working!

Thanks!

1.png

2.png

3.png

Posted
On 5/11/2020 at 7:08 PM, Wim Decorte said:

The file path window and what you feed it is not a calculation window

True, but it's worth noting that it is possible to enter a path as a mixture of literal text and variables. For example, after setting these variables:

Set Variable[ $workFolder ; Get(DesktopPath) & "werkmap" ]
Set Variable[ $filename ; YourTable::SomeField & ".jpg"

you could enter:

file:$workFolder/Beeldmateriaal/instagram/$filename

as a valid path into the Specify File window.

 

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