Csaba
|
Posted: 02/16/2005, 1:12 PM |
|
Hi All,
I'm new to Java and CCS. I'm trying to do the following: when the user submits a record, I'd like to create an additional record in a different table, to link the just created record to something else. For this, I would need to get the newly created PK value for the record.
Two questions:
It seems that this code should go to the afterExecuteInsert event. This event has one parameter, which is DataObjectEvent type. Where does one find the documentation for this? I couldn't find any reference to this in the CCS help.
Also, is it possible to get back the newly created PK through the DataObjectEvent object? I'm using MSSQL as the backend, so I'm hoping a SELECT @@identity will work, or if not, I could look up the MAX(PK) from the table in question (which sucks). However if this object already has that I'd like to use that.
|
|
|
peterr
Posts: 5971
|
Posted: 02/16/2005, 8:47 PM |
|
There is an example of retrieving the last inserted record in the "Multi-Step User Registration" example in CCS Example Pack. This happens on this page: http://examples.codecharge.com/ExamplePack/MultiStepReg...gistration1.php
You can create a new project in CCS based on the above example and analyze how it works.
Otherwise our support may also be able to help you.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
|