This topic is locked

Add Event after Record

3/25/2012 4:00:15 PM
PHPRunner General questions
R
Raptor author

I have 2 tables [Patient Information] and [Notes] that are linked by a column called PatientID. When I add a record on the patient information page I would like to also add a note that a new record is added. Here is the code that I am trying but it is leaving off the PatientID value. Also the patientid value is automatically assigned when the recorded it added the database.
'** Insert a record into another table ****

dal.Notes.PatientID=Session(strTableName & "_masterkey1")

dal.Notes.Note="New Claim added"

dal.Notes.Date=[Date]

dal.Notes.Priority="New Claim"

dal.Notes.Enteredby=SESSION("UserID")

dal.Notes.Followup=[Date]

dal.Notes.Add()
AfterAdd=true
Thank You for your help.

D
danaci 3/26/2012

your detail table is ex.

id primary key auto_increment int(9)

relationfield int(9)
$values["relationfield"]=$_Session(strTableName & "_masterkey1")

Sergey Kornilov admin 3/26/2012

Nick,
this is a PHPRunner forum while you are posting ASP code. You either got the wrong copy of code or posting to wrong forum.

R
Raptor author 3/26/2012

Thank you for responding danaci. Should the code look like this?
'** Insert a record into another table ****
dal.Notes.PatientID=$values["relationfield"]=$_Session(strTableName & "_masterkey1")

dal.Notes.Note="New Claim added"

dal.Notes.Date=[Date]

dal.Notes.Priority="New Claim"

dal.Notes.Enteredby=SESSION("UserID")

dal.Notes.Followup=[Date]

dal.Notes.Add()
AfterAdd=true

R
Raptor author 3/26/2012

How can I move this. I just noticed I started it on the wrong section.