Jump to content

Can someone please help with this script


Recommended Posts

Firstly by telling if it is even possible 

I have a customer contact database that I use to keep track of clients that use our services on an annual basis.  We are event photographers, and we are not guaranteed that a given client will rebook us every year, so I need to keep track of who the current contact is, what we offered them and so on and so forth.

When I eventually speak to the contact, I then need to follow up email with a PDF.

I have created a layout that is a letter format that contains the fields that has offer details that are specific to them. 

I want to be able to click a button that

  1.  Switches the layout from the "Form" view, to the Letter layout. 
  2. Chooses "Current Record"
  3. Save/Sends a PDF version of the Letter Layout for that current record via email using the email address that is in the email address field in the "Current Record"
  4. Uses some boilerplate text for the email that would be included *somewhere* I suppose I need to make a new field in the DB to draw that from. 
  5. Also creates a salutation for the email pulling the first name of the contact for the "Current Record" 

 

I can do just about all of these things separately in some form, but making it all one single script is something I can not do. 

 

I would really y appreciate any help with this as while I have had FileMaker since about version 5, I am by no means a developer and just need to figure this out. 

Thanks,

 

Craig

Link to post
Share on other sites
  • 2 weeks later...
12 hours ago, dtsvirinko said:

Here's how I would go about creating a script for what you describe.

p0e_qJXFB9DywrC26zGr0pxo-hX3tfuQ1fbziCVI

Hi There.

Thanks very much for  your reply.  I must state, if it is not already obvious - I am substantially less than a newb when it comes to scripting, so I apologise it there are glaringly stupid errors.

I have entered the script that you offered, and have a few questions.

1) Can I get the PDF to be created WITHOUT needing to save it manually.

2) At the moment, the PDF is created and I am asked to choose where to save it, but it does not get attached automatically  to the email -

My hope is that I can do both questions 1 & 2 automagically. 🙂

3) For the subject line, as you see in the script that I have done, I created a new variable to add the client business name to the subject field, which is great.  However, I would like to add  an additional static line of text in there.  It seems if I add any more text to that line, it just ignores everything, including the variable.  I am guessing this is a syntax error, but have no idea how to correct it. 

4) I think this a syntax error the same problem as in 3, in that if I add anything to the message box OTHER than the recipient $firstname variable, then in this case it shows exactly what I wrote, including the variables, so like this:

      Dear $firstname

     "blah blah blah" ; $path

 

If I ONLY write

$firstname

Then is shows the value for first name for that record. 

Thank you  very much for your assistance, I am very grateful for your help. 

Craig

 

 

 

Screen Shot 2020-06-13 at 3.37.53 pm.png

Screen Shot 2020-06-13 at 3.56.15 pm.png

Link to post
Share on other sites
  • Newbies

Hi Craig,

Sorry, I don't check on this forums over the weekend.

For #1. I notice that you have two Save to PDF script steps. You don't need the first one and just need the second. Make sure that you've selected "without dialog." That would take care of the saving part.

For #2. In the email setup dialog, at the very bottom notice the Attach File checkbox. Select the box. And then in Specify enter the $path variable.

This should take care of it for you. Let me know if you're still having trouble.

David.

  • Thanks 1
Link to post
Share on other sites
On 6/15/2020 at 11:12 PM, dtsvirinko said:

Hi Craig,

Sorry, I don't check on this forums over the weekend.

For #1. I notice that you have two Save to PDF script steps. You don't need the first one and just need the second. Make sure that you've selected "without dialog." That would take care of the saving part.

For #2. In the email setup dialog, at the very bottom notice the Attach File checkbox. Select the box. And then in Specify enter the $path variable.

This should take care of it for you. Let me know if you're still having trouble.

David.

Hi David

 

Thanks so much! That worked!  😀😀👍👍

The issue I am having now, is how to correctly format text in the Message field for the email that I want to send, so I don't look like I failed grade 2.  I am using a calculation and have figured out that if I add a space "Hello_" where the underscore is, then I get Hello Bob and not HelloBob, where Bob is supplied using &table::ContactFirstName

What I can not workout is how to then start a new sentence on a new line,  I have seen the Paragraph character -->  ¶¶ in the side bar of the Calculation window but clearly I have not applied it correctly. 

I would be very appreciative if you could explain this to me. 

Thanks,

Craig

Link to post
Share on other sites

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
  • Similar Content

    • By Howard LeCanard
      I know that peer to peer sharing has been deprecated. I also know that it still works on my network between two computers.
      My client has a two-person shop and has been doing peer to peer for years. He wants to upgrade from an old version of FileMaker to 19 because he is getting new computers. He has been hit hard by events this year so he wants to spend the minimum amount.
      My versions of 19 are part of a volume license, so I don't know if p2p sharing is only working because of that. Would it work with two or three individual licenses of 19?
    • By Per Lind
      Hi All!
      In Filemaker 18 and earlier it was a possibility mark this:
      Enlarge the contents of the window for better readability
      I cant find it in Filemaker 19.
      Anyone know more?
      Thanks in advance.
      -Per
       
    • By Pio Soto
      Hi,
      My issue is that my customer layout has a script trigger on LayOutEnter that sorts my customers portal list by "Active" customers,
      but when I do a go to related record from another table say from quotes or any other the customer layout does not load that customer
      or show my related customer because the OnLayoutEnter script trigger changes it, I would like it to go to the related customer and also sort it by "Active"
      on the list.
      Hope someone can help me with this.
      Thanks,
      Pio
    • By mikeytt
      Hoping someone might have the answer to this. I have two new copies of FM19. I installed on 2 machines (Catalina) but like an idiot accidentality used the same licence key on both machines.
      Not a problem I thought, just trash the app on one machine and delete the <home>/Library/Preferences/com.filemaker.client.pro12.plist  then reinstall and enter the second key (as per Claris instructions).
      But no! each time I reinstall it does NOT ask me for the licence key but automatically picks up the originally entered key.
      So I am kind of stuck. Does anyone know what other files need to be removed for a truly clean uninstall because clearly trashing the app and the preference are not what is needed to clear out the licence key?
    • By charlitoA
      Hey Everyone
       
      We are having this issue with the change of any of this variables
      IOS 13
      FileMaker 18
      FileMaker Server 18
      FileMaker Go 18
       
      We have a Layout for FileMaker go to upload photos from an iPod Touch or iPhone Pro 11, and when we use a script to take the photo directly from the camera works perfectly, but when we use the another one that has to open the library from the device it will happen either of this 2 things
       
      1. It will duplicate on the mini preview the last "good" picture and when try to maximize the picture nothing shows up
      2. It will happen this weird "no signal tv" ( that's how I call this lol ) image and there's no way to see the picture
       
      Discoverys
      On MacOS the pictures looks great, also con iOS , it seems that windows it's not detecting as a valid file when the photo is taken from the library of the iPhone or the iPod Touch (this never happen in older versions of filemaker or iOS)
       
      Any ideas ?

  • Who Viewed the Topic

    1 member has viewed this topic:
    Lee Smith 

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.