I have this code in my Application Form in my Aftervalidate event of my dialog component. This code is suppose to send an email to the client who has applied for using the web service. However I can't quite figure out how do I tie the email address to the ticket number which is an auto numeric field so that the email is sent to the user showing his/her ticket number and the expiration date of the ticket. I have tried using sql_lookup but I get this error message:
Errors in: event.AfterValidate code:
Could not execute lookup query. Reported error: Error parsing SQL statement
line 1:45: unexpected token: arogers@socialsecurity
Below is the code I have in my aftervalidate event
The ticketstatus.a5w page contains a grid component where I want the applicant's ticket number, received date and expiration date to be shown.
Thanks Rogers
Errors in: event.AfterValidate code:
Could not execute lookup query. Reported error: Error parsing SQL statement
line 1:45: unexpected token: arogers@socialsecurity
Below is the code I have in my aftervalidate event
Code:
' Write to table User details upon Registration Dim tbl as P tbl = table.open("[PathAlias.ADB_Path]\application.dbf") tbl.enter_begin(.T.) tbl.User_Fname= alltrim(CurrentForm.Controls.FirstName.value) tbl.User_lname = alltrim(CurrentForm.Controls.LastName.value) tbl.email = alltrim(CurrentForm.Controls.Email.value) tbl.Email_confirmation = alltrim(CurrentForm.Controls.EmailConfirmation) tbl.Reg_num = alltrim(CurrentForm.Controls.EmployerNumber.value) tbl.Employer_name = alltrim(CurrentForm.Controls.EmployerName.value) tbl.Trade_name = alltrim(CurrentForm.Controls.TradeName.value) tbl.Employer_address = alltrim(CurrentForm.Controls.EmployerAddress.value) tbl.Country= alltrim(CurrentForm.Controls.Country.value) tbl.Telephone = alltrim(CurrentForm.Controls.Landline.value) tbl.cell = alltrim(CurrentForm.Controls.Cell.value) tbl.Received_date =convert_type(date(),"D") 'tbl.Ticket_status=alltrim(CurrentForm.Controls.ticket_status.value) tbl.enter_end(.T.) tbl.close() 'Send emails to users upon registration, telling them their ticket number and expiration date of ticket Ticket=sql_lookup("::name::webportal","application",Alltrim(CurrentForm.Controls.email.value),"ticket_number") Expiration=sql_lookup("::name::webportal","application",Alltrim(CurrentForm.Controls.email.value),"Expiration_date") Customer_Name= alltrim(CurrentForm.Controls.FirstName.value) Customer_fullname=alltrim(CurrentForm.Controls.FirstName.value)+" "+ alltrim(CurrentForm.Controls.LastName.value) Received_date= convert_type(Received_date,"D") Expire_date= convert_type(Expiration,"D") 'tbl.close() 'Send emails to users upon registration, telling them their ticket number and expiration date of ticket pm.lrelated = .T. 'pm.from = CurrentForm.Controls.From.value pm.from_alias = "Administrator Social Security Board" pm.to = CurrentForm.Controls.Email.value pm.bcc = "" pm.subject ="Registration Confirmation" pm.qq = <<%html% <html> <head> </head> <body> Thank you {Customer_Name} for signing up for our online Electronic C3 Submission service. Your ticket number is {Ticket} and you have four(4) Business days to visit the our Office to complete the registration Process. Your ticket is valid until {Expire_date}. Failure to visit our office within the specified date would result in you having to re-register for the service .Thanks for your Compliance </body> </html> %html% pm.html_message = evaluate_string(pm.qq) email_send2(pm) 'Send Email to myself to tell me when a new User has registered pm.to="[email protected]" pm.subject="A new user just registered" pm.qq = <<%html% <html> <head> </head> <body> {Customer_fullname} has signed up for our online Electronic C3 Submission service. The ticket number is {Ticket} and is valid until {Expire_date}. </body> </html> %html% pm.html_message = evaluate_string(pm.qq) email_send2(pm) currentform.redirecttarget="ticketstatus.a5w"
Thanks Rogers
Comment