I'm trying to fire an email that contains a group of reports for a country. For instance reports due for this month or reports past due, etc.
I've got it sending 1 report per email - not what I want
and
I've got it sending all reports to every country (not just their own, but every single one) - not what I want
What I want is to send only the reports for a particular country in a single email. As in sending the 4 over due reports for Ghana in one email.
Thoughts?
********************
This sends every report in a separate email - not what I want
- temp = "";
- for each x in RSCS_Main[((Received == false && Ignore == false) && Due_Date < zoho.currentdate)]
- {
- temp = temp + x.Training_Location + " - " + x.Report_Type.Report_Name + "<br><strong>Due Date: </strong>" + x.Report_Date + "<br><br>";
- }
sendmail....
*********************
This sends all reports to all countries - not what I want
- temp = "";
- for each x in RSCS_Main[(Country is not null)]
- {
- for each y in RSCS_Main[((Received == false && Ignore == false) && Due_Date < zoho.currentdate)] // * Referring to over-due reports
- {
- temp = temp + y.Training_Location + " - " + y.Report_Type.Report_Name + "<br><strong>Due Date: </strong>" + y.Report_Date + "<br><br>";
- }
- }
********************
I tried the below, but it wouldn't let me use the "x" variable in the 2nd for each statement:
- temp = "";
- for each x in RSCS_Main[(Country is not null)]
- {
- for each y in x [((Received == false && Ignore == false) && Due_Date < zoho.currentdate)] // * Referring to over-due reports
- {
- temp = temp + y.Training_Location + " - " + y.Report_Type.Report_Name + "<br><strong>Due Date: </strong>" + y.Report_Date + "<br><br>";
- }
- }
- sendmail....