K1200 Posted July 16, 2006 Posted July 16, 2006 I have a layout displaying a portal of customer names and their e-mail addresses. I added a Send Mail button to the portal definition (beside the address field) and configured it to Send One Email To: Table::EmailAddress. It worked fine. Press the button beside the customer's address and my e-mail client would pop up showing the correct address from that portal row, ready for me to type in text to send. THE PROBLEM IS, I want to have that same button in the portal row call a script so that I can have other operations take place after the Send occurs. When the script executes, FMP apparently forgets which row was active and, as a result, doesn't pass the e-mail address to the client. Is there a simple way to make this work? Thanks for any help.
Raybaudi Posted July 17, 2006 Posted July 17, 2006 Hi yes, store the Get(PortalRowNumber) into a $$ variable before going to execute another script or into an $ variable if the script is the same.
K1200 Posted July 17, 2006 Author Posted July 17, 2006 Thanks for the response. But how do I then use the $$PortalRow in the Send Mail script step to load the correct Table::Address?
Raybaudi Posted July 17, 2006 Posted July 17, 2006 With: Go to Portal Row (by calculation and calc: $$row) Send One Email To: Table::EmailAddress.
K1200 Posted July 17, 2006 Author Posted July 17, 2006 I must really be missing something here because I've seen no change in results. My script is now: Set Variable [$Row; Value:Get (PortalRowNumber)] Paste [select; Main::Message] Go to Portal Row [select; No dialog; $Row] Send Mail [To: Table::Address; Message: Main::Message] The Message gets passed to the e-mail client, but the address is still blank. Any ideas?
Raybaudi Posted July 17, 2006 Posted July 17, 2006 What are the script steps before the SetVariable script step ? How can you paste something without coping ? Remember that the $row must be definited as the very first script step and can't go on when the script ends. Otherwise you have to use $$row !
K1200 Posted July 17, 2006 Author Posted July 17, 2006 The Paste step places the contents of the clipboard as the message text (whatever the user has selected and copied before clicking on the portal row button). My script is only 4 steps just as shown, with the Set Variable as the first step.
K1200 Posted July 17, 2006 Author Posted July 17, 2006 I FOUND THE PROBLEM! The Paste[select] deselects the active portal, which caused the GoToPortalRow to go to "the first portal in the layout stacking order" (according to the manual). I took a slightly different approach and just captured the address instead of the row. My script is now: Set Variable [$Address; Value:Table::Address] Paste [select; Main::Message] Send Mail [To: $Address ; Message: Main::Message] It works. Thanks Daniele for your assistance on this.
Raybaudi Posted July 17, 2006 Posted July 17, 2006 Hi happy that you solved... but, hei, you didn't say to me that there was more than a portal ! :P
Recommended Posts
This topic is 6696 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 accountSign in
Already have an account? Sign in here.
Sign In Now