willrollo Posted May 19, 2016 Share Posted May 19, 2016 I want to be able to automatically populate my email subject with several 'reference' fields from a found set of related records. The context is I have a few invoice tables related to a single customer - I want to be able to email the customer these, but as the subject, I would like the three or so invoice numbers as the email subject. I have tried a Loop and set variable but it isn't working so would appreciate any advice... FIND RECORDS Go To record/request/page [first] Loop Set Variable [$Reference ; INVOICE DETAILS::Reference] Go to record/request/page [next ; exit after last ] End Loop Send Mail.. It all works except in this case the subject field remains empty - If I remove the loop it just sets the first record's reference as the variable, obviously! Link to comment Share on other sites More sharing options...
AHunter3 Posted May 19, 2016 Share Posted May 19, 2016 (edited) Well, you didn't bother to include the specifics of your Send Mail script step and my crystal ball is all fogged up, but rather than guess what you have in your existing script... FIND RECORDS Go To record/request/page [first] Loop Set Variable [$Reference ; $Reference & Left (", "; Length ($Reference) ) & INVOICE DETAILS::Reference] Go to record/request/page [next ; exit after last ] End Loop Send Mail [ To xx@whatever, Subject: $Reference, Body=yadda yadda, one email not one per each rec in found set, no dialog] Edited May 19, 2016 by AHunter3 Link to comment Share on other sites More sharing options...
willrollo Posted May 19, 2016 Author Share Posted May 19, 2016 Your Crystal ball worked fine as did your answer - thank you very much. It works perfectly... Link to comment Share on other sites More sharing options...
Recommended Posts