This topic is locked

Capture field editID1

12/12/2007 1:28:32 PM
ASPRunnerPro General questions
N
nrijo author

Dear Support,
I need to be able to capture record id (editID1) after I edit a record so I can append an entry to an audit trail table. I want to keep track of which record is being updated by users.
I am able to get the current user login (Session("...").
I tried using dict(editID1), request.form("editID1") and request.Querystring("editID1") in Before Record updated and After record updated event, but nothing work.
When I tried request.form("editID1"), I got this error saying I couldn't use request.form after a binary.....
Please help.
Noel

Sergey Kornilov admin 12/12/2007

In ASPRunnerPro 5.1 use keys("KeyColumnName")

N
nrijo author 12/13/2007

Hey Sergey,
I tried the following code in After Record Updated event:
strSQLSave = "INSERT INTO CTO_Audit(GCO_Number, Coordinator_Name, AuditType) values ('" & keys("editid1") & "','" & Session("UserID")& "','Edit - Study')"

dbConnection.Execute strSQLSave
I see a new entry on the table CTO_Audit, but is missing the editid1 in the GCO_Number.
Any suggestions.
Thanks in advance.
Noel

Sergey Kornilov admin 12/13/2007

Please read my answer one more time.

N
nrijo author 12/13/2007

Sergey,
My apologize for my ignorance. I didn't think I could call on variable using the DB field names.
Noel