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 Nick Lightbody
      My new piece on Medium - with an in depth performance analysis between different types of deployment for FileMaker Server.
      Deployment in a Docker Container on a powerful cloud server comes out as a standout option.
      It will be fascinating to hear your own experience - does it differ from what my testing reveals?
      It will also be fascinating to hear from Wim how the results he gets from his new Punisher performance tool compare with what we get with dsBenchmark?
      Cheers, Nick

      https://nicklightbody.medium.com/claris-filemaker-server-19-a-performance-test-of-linux-v-windows-4bb007b5e2d7
       

    • By Don_Macaroni
      I have a regular text field with a height of 20 px in Layout mode. In Browse mode that height is respected. But when I select the field, the height seems to triple and a blue border is added. How do I get rid of this behavior? No doubt it has to do with the stupid Themes thing, but how do I edit that? And is there a way to completely remove the Themes/Styles from a database? This feature has zero usable themes as they are ALL UGLY. I create a nice pro look and copy paste fields, Filemaker Themes/Styles s*ck.
    • By Mafia2020
      I have a calculation that goes like that, I input a number on "Base Imponibile" (say 100), it adds 15% (it gets me 115), it then calculates 4% to the previous result (115) and it gets me 4,60, I then add 2 and the total is 121,60 which is perfect.
      And that's the part that works just fine. But I then want to make a reverse calculation, where I input the expected result of Total Calculation and tells me all the other values and here it's where things go awry.
       
      I'm attaching the initial calculation that works as a reference and the reverse calculation which doesn't work as an example. The "2" that gets subtracted in the reverse calculation is a fixed value of a small tax that I have to deduct (imposta di bollo).
      I have a feeling that the reverse calculation goes crazy because of some unwanted rounding somewhere, but I am not to sure, so I seek the opinion of more calculation versed persons around.


    • By Mafia2020
      I know the solution is probably very easy but it escapes me. I got this database, which I use to create invoices, year after year, I created a report page where with a neat summary field I get the "lifetime revenues", "lifetime general expenses", "lifetime total taxes" and "lifetime total invoices number", which is handy, but I need to have the same data broken down by year, and I can't figure out how to achieve that.
      In another post I have been suggested to consolidate the three tables I had (Invoices 2018, Invoices 2019 and Invoices 2020) into a single table (Invoices) and then use a "subsummary" which would give me the data I want based on how I sort the records but I am not sure how to use subsummaries nor I am sure I want something where I have to multiple click to re-order records to get data one at a time; I'd rather prefer a report where a calculation of some sort would make a sum of the total revenue of my invoice records broken down by year, as I exemplified in the database I'm attaching, is that possible in an easy, possibly not involving complicated subsummaries way?
      I'm beginning to get desperate on the subject, please have mercy.
      Invoices Demo.fmp12
    • By Mafia2020
      I'm not even sure to describe under which category my specific problems fall into, I can only advance some hypothesys, so I'll just describe it and let the wisdom of others guide me.
      I have a DB with several tables, I use them to make invoices. With every invoice I input the desired price and it adds automatically 19% taxes and produces a neat invoice which I can print, these three tables are called:
      Invoices 2018
      Invoices 2019
      Invoices 2020
      Now on to my problem. I wanted to create a forth table where from every previously listed table it would calculate the total revenue of the year in question, broke down like this:
      - Total Net price paid for 2018
      - Taxes for 2018
      - Total revenue for 2018 (net+taxes)
      - Total Net price paid for 2019
      - Taxes for 2019
      - Total revenue for 2019 (net+taxes)
      - Total Net price paid for 2020
      - Taxes for 2020
      - Total revenue for 2020 (net+taxes)
       
      I am unsure how to proceed, I tried creating a forth layout and a new table but I have problems brining the summary field from each year's table into the forth table/report/layout.
  • Who Viewed the Topic

    2 members have viewed this topic:
    laguna92651  splatto 
×
×
  • Create New...

Important Information

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