The intent is that the record is inserted with an alternate key (which is the value that should be placed in lookupKey), and that the alternate key is used to look up the primary key. So basically, your lookupKey should point to your table's alternate key column.
HTH, David ----- Original Message ----- From: "Jeff Fleitz" <[EMAIL PROTECTED]> To: "[email protected]" <[email protected]> Sent: Monday, June 06, 2005 4:20 PM Subject: [plum] InsertRecordAndReturnKey > I am trying to use the above method in the DatabaseBlocks component to return the value of an identity key (VesselID) > for a single table insert, so that I can use the returned key to generate child and grandchild records on-the-fly. > > Question: Is this method intended to only work with Chooser controls, or should we be able to use it to insert and > return keys from single tables? > > Here is a simplified version of what the query looks like: > > <cfscript> > // Insert the Vessel row, and return the newly created identity key > newKey = Application.DatabaseBlocks.InsertRecordAndReturnKey( > table:"Vessel", columns:"VesselName", > values:"'#Form.VesselName#'", > primaryKey:"VesselID", > lookupKey:"VesselID", > lookupKeyValue:"VesselID"); > </cfscript> > > Where am I going wrong? > > It doesn't look like the method is written to handle this instance, but wanted to check. > > > Jeff > > > ********************************************************************** > You can subscribe to and unsubscribe from lists, and you can change > your subscriptions between normal and digest modes here: > > http://www.productivityenhancement.com/support/DiscussionListsForm.cfm > ********************************************************************** > ********************************************************************** You can subscribe to and unsubscribe from lists, and you can change your subscriptions between normal and digest modes here: http://www.productivityenhancement.com/support/DiscussionListsForm.cfm **********************************************************************
