joseppic Posted May 9, 2003 Posted May 9, 2003 Hi folks, I would like to provide my users with a button to eMail the results of a find, i.e. place fields from multiple records in the same eMail body. What's the best way of doing this please? thank you, J.
cjaeger Posted May 9, 2003 Posted May 9, 2003 make a blank layout with only the fields you want to have included go to layout newlayout copy all records go to layout , back paste, mailbody
joseppic Posted May 9, 2003 Author Posted May 9, 2003 Hi Christian, can you please explain what 'back paste, mailbody' means, are these script functions? J.
joseppic Posted May 9, 2003 Author Posted May 9, 2003 Hi, When I 'copy all records', how do I then get the contents of the copy into an eMail body? Do I create a global field and then what? Can someone explain sep-by-step please? thanks for your help. J.
CobaltSky Posted May 9, 2003 Posted May 9, 2003 Hello joseppic, Christian was providing his instructions in a somewhat cryptic shorthand. What he was trying to say was: 1. Create a field (preferably a global text field) called 'mailbody', and place it on a layout called 'MailBody Layout'. 2. Create a layout called NewLayout, and place on it all the fields that you want included in your email. Make sure it is defined as a 'View as List' layout in the Layout options view tab. 3. Set up a script which has the following steps in it: Freeze WIndow Go To Layout ["NewLayout"] Copy All Records Go To Layout ["MailBody Layout"] Paste [select, "mailbody"] Go To Layout ["original layout"] Send Mail ["mailbody"] The last step of the script is one where you include the 'mailbody' field as the body of the email. The preceding steps will gather the data from the fields which you've placed on the NewLayout layout, from all the records in the current found set, and paste them into the mailbody field. Once you have found the records that you want to mail data from, you will be able to call the above script (perhaps as a sub-script of your find script?) to gather together the required information for the email. :
joseppic Posted May 9, 2003 Author Posted May 9, 2003 Splendid, thanks very much. I have another question - I'm using Mozilla 1.3, for some reason I cannot get the 'to' email address populated - it remains blank. Any ideas? Can I also get some advice as to the best way of formatting this data so its not just a continuous line of text. thank you for your patience. J.
joseppic Posted May 9, 2003 Author Posted May 9, 2003 The 'copy all records' is only getting the first record from a portal in this view, how do I get the others? thanks, J.
CobaltSky Posted May 9, 2003 Posted May 9, 2003 Hi joseppic, In your original post, you referred to wanting to include fields from multiple records in the bofy of your emails, but you omitted to mention that some of the records were in different files. That's a challenge of a slightly different order. Moreover, although the solution that Christian suggested is a fairly easy way to acquire data from multiple records within the same file, it does not provide options for control over the format - eg inclusion of line breaks at appropriate places etc. Given that you need to acquire data which is appearing in a portal, I suggest that the retrieval of the data should either occur within the related file (calling on fields from the main file via a relationship back to that file if required) or within a script which loops through the records and then through the portal rows within the main file. The fact that you need to add carriage returns or spaces or other characters to the mix is an added reason to use a technique where the record contents are concatenated together and placed into your global field via a script which loops through the relevant records. If the script resides in the related file, it can be called as an external sub-script from your main file immediately before the Send Mail [ ] step. If it is in the main file, the loop steps can precede the Send Mail Step within the same script. The way the script would have to be constructed depends on your actual data structure and you've not said anything about what that is, so we're somewhat in the dark. However based mainly on guesswork, the sub-script in your related file would be likely to look something like this: Perform Find [Replace Found Set] Set Field["MainFile::mailbody", " "" "] Go To Record/Request/Page [First] Loop Set Field["mailbody", "mailbody & "
joseppic Posted May 15, 2003 Author Posted May 15, 2003 Hi, thanks for your reply. I ended up doing this last sunday when I could not access this site, so what id did was: Wherever there was a portal for data I created a value list of keyfields for this related data. I then used a calculation to get this list into a field and then used this field in a relatinship. Once in a relationship I was able to get the data I needed into a field. I then used Calculwtions to wrap html around the fields I wanted to send and then placed these calculated fields in a layout. I then copied the contents of this layout and pasted it into a Global mailBody field. This field became my mail body. Thanks for your help. Do you know why I can't get any email addresses in the to field? thanks, J.
CobaltSky Posted May 15, 2003 Posted May 15, 2003 Hi joseppic, Do you know why I can't get any email addresses in the to field? without at least a little information about your structure and your 'to' field and the methods you are trying to use to get information into the field, one can only offer a blind guess at why they might be failing. Some of the more obvious reasons would be: 1. Your 'to' field is not defined as a text field 2. The 'Send Message [ ]' script step does not have the correct data field specified in its parameter dialog. 3. Your 'to' field is not present on the current layout at a time a script tries to paste to it. But there are many other possibilities, depending on how you have it set up, so the above suggestions are little more than stabs in the dark.
Recommended Posts
This topic is 7855 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