This topic is locked

URL Link to Master record

8/11/2008 1:41:43 PM
ASPRunnerPro General questions
C
cmayers author

I am sending an email to the email address in the record to notify them of a record in the application. I would like to give them them URL to bring up the record being saved. porID is the ID field for the Master table.
' Parameters:

' dict - Scripting.Dictionary object.
'** Send email with new data ****
message ="POR added "

message = message & vbcrlf & "POR Date" & " : " & dict("PORDate") & vbcrlf

message = message & vbcrlf & "Creator" & " : " & dict("Author") & vbcrlf

'message = message & vbcrlf & "PorID : " & dict("PorID") & vbcrlf
message = message & "http://localhost/DealerPORs/DealerPors_list.asp?mastertable=por%2EDealerPors&masterkey1="; & dict("porID") & vbCrLf

message = message & vbcrlf & "Please log into Dealer PORs before clicking on URL" & vbcrlf
email=dict("Email")

subject="New POR record"
sendmail email, subject, message

J
Jane 8/12/2008

Hi,
I'm not sure that I understand you.

What URL do you want to send?

C
cmayers author 8/12/2008

Hi,

I'm not sure that I understand you.

What URL do you want to send?


the URL of the record with the ID in the emailso the user knows there is an issue to deal with. The URL in the script brings up the login but I need it to go the record referenced by the ID in the email - PorID.
Carol

J
Jane 8/13/2008

Carol,
here are some tips:

  1. change URL in the email body:
    ...

    message = message & "http://localhost/DealerPORs/DealerPors_list.asp?table=DealerPors&user="; & Session("UserID") & "&mastertable=por%2EDealerPors&masterkey1=" & dict("porID") & vbCrLf

    ...



2. add Login page: Before process event on the Events tab:

if request.querystring("user")<>"" and request.querystring("table")<>"" then

str="select * from UsersTable where Username='" & request.querystring("user") & "'"

Set rsTemp = server.CreateObject("ADODB.Recordset")
rsTemp.open str, dbConnection
SESSION("UserID") = request.querystring("user")

SESSION("AccessLevel") = ACCESS_LEVEL_USER
rsTemp.Close

set rsTemp = Nothing

Response.redirect request.querystring("table") & "_list.asp?mastertable=por%2EDealerPors&masterkey1=" & request.querystring("masterkey1")

End if

C
cmayers author 8/13/2008

Carol,

here are some tips:

  1. change URL in the email body:
  2. add Login page: Before process event on the Events tab:


8/13/2008

I am getting the login page with a message saying my session has expired. I use a username and a password. When I paste the URL from the email I still see all my records and it does not take me to the one with the id in the url.
Carol

J
Jane 8/14/2008

Carol,
It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.