This topic is locked

Use where in Events

6/29/2008 5:10:06 PM
ASPRunnerPro General questions
jfr author

Hello,
I want to send an email, only when certain clause is met.

How can I simply build in a 'where' clause in the Email event?
The following is in the application.

I have a customer table in my database with a Yes/No clause.

I only want to send an email when Yes is selected.
Thanks a lot and have a great Sunday,
John

J
Jane 6/30/2008

John,
here is a sample:

if dict("FieldName")="Yes" then

'send email here

end if

jfr author 6/30/2008

So easy,
Thanks soo much Jane,
John

jfr author 6/30/2008

Jane,
I was a little to fast thanking you.
This is the code which I am using, but am getting a 424 error.

if dict(dbo.Verkooprelatie.iAlert_klant)="Ja" then
Dim dkeys

message =""
dkeys = dict.keys

For n = 0 To dict.Count-1

message = message & dkeys(n) & " : " & dict(dkeys(n)) & vbcrlf

Next



email="info@info.com"

subject="New data record"



sendmail email, subject, message

end if
Response.Redirect "Verkooprelatie_list.asp"
jfr author 6/30/2008

Jane,
That one got solved, but I won't get an email on the following code.

I checked the database, and the value of the field = Ja.
John

if dict(iAlert_klant)="Ja" then
Dim dkeys

message =""
dkeys = dict.keys

For n = 0 To dict.Count-1

message = message & dkeys(n) & " : " & dict(dkeys(n)) & vbcrlf

Next



email="info@info.com"

subject="New data record"



sendmail email, subject, message

end if
Response.Redirect "Verkooprelatie_list.asp"
Sergey Kornilov admin 6/30/2008

if dict("iAlert_klant")="Ja" then

jfr author 7/1/2008

Thanks,
It works!
John