Does anyone have the time to take a look at this code and fill me in on what I'm missing? I've tried to research as much as possible and was able to cut the code down from massive size to an acceptable level but I am still not getting the proper result.
I need to scan a form of 28 values for Datedue matching today's date and email the names of the documents that are due to the specified people.
Below is what I've come up with so far but I still only get the last document name in the email instead of all docs that are due.
------------------------------------------------------------
'Begin Code
IF is_object(topparent.this) THEN
form_name = topparent.name()+".this"
ELSE
form_name = ""
END IF
DIM documents[30] AS C
FOR counter = 1 TO 30
IF eval(Current("Buyers-"Bdatedue") + ltrim(str(counter))) = date() THEN
to_var = a5_eval_expression("People-"Email")
param_to = to_var
subject_var = a5_eval_expression("People-"First_Name")
param_subject = subject_var
DIM documents[counter] AS C
documents[counter] = a5_eval_expression("Buyers-"BDocs" + ltrim(str(counter)))
param_message = documents
attachment_list = ""
param_attachments = alltrim(attachment_list)
param_cc = ""
param_bcc = ""
END IF
NEXT counter
email_client(param_to,param_subject,param_message,param_attachments,param_cc,param_bcc,.t.,"")
'End Code
-----------------------------------------------------------
I found references that lead me to believe I could use the same local variable 'counter' for both the checking of form fields and reporting in the email message instead of manually typing out a complete array of 30 variables. Am I wasting my time on this approach?
Rick
I need to scan a form of 28 values for Datedue matching today's date and email the names of the documents that are due to the specified people.
Below is what I've come up with so far but I still only get the last document name in the email instead of all docs that are due.
------------------------------------------------------------
'Begin Code
IF is_object(topparent.this) THEN
form_name = topparent.name()+".this"
ELSE
form_name = ""
END IF
DIM documents[30] AS C
FOR counter = 1 TO 30
IF eval(Current("Buyers-"Bdatedue") + ltrim(str(counter))) = date() THEN
to_var = a5_eval_expression("People-"Email")
param_to = to_var
subject_var = a5_eval_expression("People-"First_Name")
param_subject = subject_var
DIM documents[counter] AS C
documents[counter] = a5_eval_expression("Buyers-"BDocs" + ltrim(str(counter)))
param_message = documents
attachment_list = ""
param_attachments = alltrim(attachment_list)
param_cc = ""
param_bcc = ""
END IF
NEXT counter
email_client(param_to,param_subject,param_message,param_attachments,param_cc,param_bcc,.t.,"")
'End Code
-----------------------------------------------------------
I found references that lead me to believe I could use the same local variable 'counter' for both the checking of form fields and reporting in the email message instead of manually typing out a complete array of 30 variables. Am I wasting my time on this approach?
Rick
Comment