mramirez18
Posts: 56
|
Posted: 04/01/2005, 7:24 AM |
|
Can someone tell me why my record does not show the record ID for my link
Report has been created, to edit Report follow the link http://localhost/weekly/Tasks.asp?ID=
it should be something like http://localhost/weekly/Tasks.asp?ID=30&
This comes from BEFORE SHOW EVENT which sends an email when record is created.
|
|
|
Nicole
Posts: 586
|
Posted: 04/02/2005, 5:57 AM |
|
What is ID? Where it comes from? If it comes from URL use GetParam() function to retrieve its value. If it is a field on a form get its value from fldfield_name variable.
_________________
Regards,
Nicole |
|
|
Manny Ramirez
|
Posted: 04/02/2005, 5:04 PM |
|
sSQL1 = "select ID from Tasks where Date_Submitted= #" & fldDate_SubmittedH & "#"
openrs rs1, sSQL1
IDvar = GetValue(rs1, "ID")
URL = "http://"+Request.ServerVariables("SERVER_NAME")+Request.ServerVariables("SCRIPT_NAME")
URL = mid(URL,1,InstrRev(URL,"/"))
sSQL2 = "select user_email, user_sec_lev FROM Users WHERE receive_emails = 1 AND user_sec_lev = 2"
openrs rs2, sSQL2
sSQL3 = "select user_name from users where user_id=" & fldUserID
openrs rs3,sSQL3
user_name = GetValue(rs3,"user_name")
while not rs2.EOF
receive_emails=GetValue(rs2,"user_email")
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = "blah@blah.com"
objCDO.To = receive_emails
objCDO.Subject = "Report for " & user_name & " has been submitted."
objCDO.Body = "Report has been created, to edit Report follow the link " & URL & "Tasks.asp?ID=" & IDvar
objCDO.MailFormat = 0
objCDO.Send
set objCDO=Nothing
rs2.MoveNext
wend
|
|
|
Nicole
Posts: 586
|
Posted: 04/04/2005, 1:58 AM |
|
It happens that IDvar is empty. It may happen if recordset returned for sSQL1 is empty or if fldDate_SubmittedH is empty or invalid and thus query was not executed properly.
_________________
Regards,
Nicole |
|
|
Manny Ramirez
|
Posted: 04/11/2005, 9:13 PM |
|
fldDate_submittedH is a Hidden Date field, Default Value =date()
fldDate_submitted is a Label Date Field, Default value = date()
When record is created ID is auto increment numbver.
|
|
|
Nicole
Posts: 586
|
Posted: 04/12/2005, 4:20 AM |
|
You can print the query before executing it. Then copy it and test in query analyzer. If any database error is returned you’ll get it that helps you to identify what it wrong.
_________________
Regards,
Nicole |
|
|
mramirez18
Posts: 56
|
Posted: 04/14/2005, 9:37 PM |
|
I managed to fix the problem. Thanks
|
|
|
|