I have a fairly simple Record, just a numeric PK and a description.
What I'm trying to do is create a new entry, and return it's PK value.
Thus:
<cfset var o=variables.ReactorGatewayWay.createRecord("file")>
<cfset o.setfile_desc = arguments.properties.description>
<cfset o.save()>
<cflog text="** after save in file.cfc: #o._getTo().file_id# =
#o.getFile_id()#"/>
*But* for some reason this always gets back '0' (the default value for the
field), even though the DB gets a new record with an ID of 2.
As a first step, I copied the base executeSave() into the
project/projectName/fileRecord.cfc, and added some debug:
<cffunction name="executeSave" access="private" hint="I actually save
the record." output="false" returntype="void">
<cfset beforeSave() />
<cfif isDirty()>
<cflog text="** before save: #_getTo().file_id#">
<cfset _getDao().save(_getTo()) />
<cflog text="** after save: #_getTo().file_id#">
</cfif>
<cfset afterSave() />
<cflog text="** after after save: #_getTo().file_id#">
</cffunction>
and in all 3 lines I get back the correct value for the PK - 2.
Does anyone have any ideas ?
--
Tom Chiverton
****************************************************
This email is sent for and on behalf of Halliwells LLP.
Halliwells LLP is a limited liability partnership registered in England and
Wales under registered number OC307980 whose registered office address is at St
James's Court Brown Street Manchester M2 2JF. A list of members is available
for inspection at the registered office. Any reference to a partner in relation
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law
Society.
CONFIDENTIALITY
This email is intended only for the use of the addressee named above and may be
confidential or legally privileged. If you are not the addressee you must not
read it and must not use any information contained in nor copy it nor inform
any person other than Halliwells LLP or the addressee of its existence or
contents. If you have received this email in error please delete it and notify
Halliwells LLP IT Department on 0870 365 8008.
For more information about Halliwells LLP visit www.halliwells.com.
We are pleased to announce that Halliwells LLP has been voted AIM Lawyer of the
Year at the 2005 Growth Company Awards
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --