Raymanj Posted April 24, 2005 Share Posted April 24, 2005 What is the best way to grab all the related records for one record and move that data into a global text field so I can parse the data and formate it? I already have a script that sends an email of my invoices as a text email. I do this by pulling up the invoice record. Then a GTRR step (for line items) and moving to a special layout that shows only the fields I need in a list. I then use the copy all records script step. Then move to another layout that has a global text field and paste the data into it. Now I am able to parse the line items data and formate it. Then I use another global text field to create the text email invoice. Then send this to the email program. What I want to change in this the copy all records step for the line items. This step overwrites all data on the clipboard. This is bad if a user has something already in the clipboard. Does anyone know of a better way to do this? Link to comment Share on other sites More sharing options...
aaa Posted April 25, 2005 Share Posted April 25, 2005 Create script: GTRR SHOW Set Field[Global_Field,""] Loop Set Field[Global_Field,Global_Field&FIELD1&FELD2&FIELD3...Your FIELDS Go to Rec[next, exit after last] EndLoop Link to comment Share on other sites More sharing options...
Robert Schaub Posted April 25, 2005 Share Posted April 25, 2005 Here oan old one I did for emailing but it will work just the same for your problem Code: Create a global field called Message_Calculator Create a field called Multi_Emails= calc = Name_Field & " "& Date_Field & "¶" Telephone & " "& Email_Field & "¶" &Address_field & " "& City_Field & " "& State_Field & " "& Zipcode_Field ( Or use Whatever fields you want to include in the email). Store as text ,and in storage options choose Unstored. also in the calc place space in between the quotes that separate the field names. Each time you use one of these "¶" it will cause a line break. You can also add in the calc literals such as "Name: " or "date: " and so on as long as they are separted by a & or & "¶" &. Now for a scriptFind Muti_emails for today(remember you can set you search anyway you want). Enter Find Mode [ ]Setfield (Date_Field (Today))Perform find [ ]loopSet Field ( Message_Calculator( Message_Calculator & "¶" & Muti_emails))go to record request [next][exit after last]end loop Source post http://www.maclane.com/ubbthreads/showflat.php?Cat=0&Number=72239&an=0&page=5#72239 Looks a little wierd since the new software in this forum , but you get the idea. Link to comment Share on other sites More sharing options...
Raymanj Posted April 28, 2005 Author Share Posted April 28, 2005 What do you think is faster to grab those related records, the copy all records method I have done or loop through the records in your example? I will try this out thanks Link to comment Share on other sites More sharing options...
Robert Schaub Posted April 28, 2005 Share Posted April 28, 2005 The loop is intended to be done in a small found set....so by all means if you add a GTRR SRRO before ist will be faster. Link to comment Share on other sites More sharing options...
Raymanj Posted April 28, 2005 Author Share Posted April 28, 2005 What does SRRO mean Link to comment Share on other sites More sharing options...
Inky Phil Posted April 28, 2005 Share Posted April 28, 2005 'Show only related records' which is an option of the 'Go to related record step' Phil Link to comment Share on other sites More sharing options...
Ender Posted April 28, 2005 Share Posted April 28, 2005 I didn't catch that acronym either. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.