gsr
03/09/2025, 10:28 PM<cffunction name="delete" output="false" returntype="boolean">
<cfargument name="donation_id">
<cfargument name="rowid" default="">
<cfif len(trim(arguments.rowid)) or (isdefined("arguments.donation_id") and len(trim(arguments.donation_id)))>
<cfquery name="qDeletetemple_donation_form" datasource="#variables.dsn#">
DELETE FROM
temple_donation_form
WHERE
<cfif len(trim(arguments.rowid))>ROWID = <cfqueryparam value="#arguments.rowid#" cfsqltype="CF_SQL_VARCHAR"><cfelse>
donation_id = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#arguments.donation_id#">
</cfif>
</cfquery>
<cfreturn true>
<cfelse>
<cfreturn false>
</cfif>
</cffunction>
what if i have to improvide it using cftransatcion tags and try catch blocks and log ethe error in ac csv and display a nice message back to user, recommendations welcomezackster
03/10/2025, 3:08 PMwebsolete
03/10/2025, 4:04 PMgsr
03/10/2025, 4:32 PM<cffunction>
<cfarguments>
<cftransaction>
<cftry>
<cftransaction action="begin">
do the query stuff or whatever
<cftransaction action="commit"/>
<cfaccth type="any">
<cftransaction action="rollback"/>
<cflogging>
</cftry>
</cftransaction>
<cfreturn>
</cffunction>
not sure if there is anything betterzackster
03/10/2025, 6:02 PM