July 16, 200619 yr 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.
July 17, 200619 yr 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.
July 17, 200619 yr Author Thanks for the response. But how do I then use the $$PortalRow in the Send Mail script step to load the correct Table::Address?
July 17, 200619 yr With: Go to Portal Row (by calculation and calc: $$row) Send One Email To: Table::EmailAddress.
July 17, 200619 yr Author 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?
July 17, 200619 yr 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 !
July 17, 200619 yr Author 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.
July 17, 200619 yr Author 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.
July 17, 200619 yr Hi happy that you solved... but, hei, you didn't say to me that there was more than a portal ! :P
Create an account or sign in to comment